473,395 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

290 100+
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 ?
Jan 2 '10 #1
1 2500
Dormilich
8,658 Expert Mod 8TB
try the date() function.
Jan 2 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sugapablo | last post by:
How do you convert a unix timestamp to date('Y-m-d H:i:s')?
3
by: smp7dg | last post by:
I'd like to write a query which will get all results from last month from a table. It should look something like this: Select from where >= '' I cannot hardcode the date or programatically...
4
by: Gary Jackson | last post by:
I present a radio show on a voluntary radio station every Sunday between 3 and 5pm Is there a script which will change one graphic between those times? Be nice if my web page could change to...
1
by: Fibre Optic | last post by:
Hello, I am looking for way to convert date i.e. "Fri Feb 23 06:13:55 EST 2007" to unix time stamp? Does any one know a library which could be help full? Regards, Fibre Optic
2
by: Gooseman | last post by:
Hi, I have a query which works for one day: SELECT SOME_COL AS something, SOME_COL2 AS something2 FROM myTable WHERE DATE = '2007-05-11' AND SOME_STAT 1 Returns something something 2
2
by: aloke.sarnobat | last post by:
Hello, I am new to this forum, so your help would be most appreciated. I am trying to create a javascript where, on clicking a button, I will be able to download the latest log file. But the...
1
by: jason1987 | last post by:
Hi, I need to get previous day from an existing date stored in a varaible $date which will not include any weekend (saturday and sunday) if it is on monday date should be for friday How can I do...
2
by: ravi | last post by:
hi friends, can we display last ten dates from current system date using sql query. example todays date 19/4/2008 from this last 10 days 18/4/2008 17/4/2008 16/4/2008 ' '
2
by: suganya | last post by:
Hi I have to block all previous date in calendar. for that I have given coding as protected void QuickCalendar_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e) ...
2
by: NitinSawant | last post by:
Hello Experts, I'm newbie to php, I want to get date 30 day back from current date using php. i'm able to get current date, $currentDate= date("d-M-y",time());
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.