473,695 Members | 2,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

290 Contributor

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

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

I need to do this based on the timestamp data
I know there is some thing to do this MySQL:

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 2513
8,658 Recognized Expert Moderator Expert
try the date() function.
Jan 2 '10 #2

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

Similar topics

by: Sugapablo | last post by:
How do you convert a unix timestamp to date('Y-m-d H:i:s')?
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 generate it. The same exact query must be used every month. Is this possible? How can I do this?
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 "ON AIR", but it's beyond me how to do it. TIA Gary Jackson
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
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
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 log filename changes everyday as it takes the current date as part of the filename. eg. EMEA_20070806 i.e. EMEA_yyyymmdd Also, the previous day's log file is stored in the same directory.
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 this?? Thanks, Jas
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 ' '
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) { if ((e.Day.Date < DateTime.Now)) {
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());
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.