How to change unix date into day-of-the-year integer ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeddiki
    Contributor
    • Jan 2009
    • 290

    How to change unix date into day-of-the-year integer ?

    Hi,

    I want to number my records in the table according to
    the number day number of the year.

    so
    Jan 1st 2010 = 1
    Jan 31st 2010 = 31
    Feb 4th 2010 = 35
    7th Mar 2010 = 66
    etc

    I need to do this based on the timestamp data
    I know there is some thing to do this MySQL:
    DAYOFYEAR() and FROM_UNIXTIME()

    but I can not find the same type of functions
    for PHP.

    I want to take the number 1262344313 and get 1
    which is Jan 1st 2010.

    Any ideas ?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    try the date() function.

    Comment

    Working...