SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Oct 2000
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get week number from date

    I'll start by saying that I hate working with date and time in PHP.
    Anyway, my problem is probably very simple.

    I need to get the week number from a date.
    Date format is YY-MM-DD (Not from a MySQL database).

    Let's say it's $date = '2005-05-02';
    I assume I can just use date("W",$date), but the problem is that $date need to be converted into a UNIX timestamp first, if I'm not mistaken.

    How do I do that? I've tried using strtotime(), strptime(), mktime(), etc., but with no success.

    As I said, probably a simple problem :/

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •