Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 4th, 2006, 4:46 AM   #1
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 439
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
Question Daylight Savings Time

Will this snippet of code ignore daylight savings time and give me the ACTUAL time in the format I want?
echo date("YmdHis", time());
The reason I ask is because I need to generate a unique time stamp and if I had overlapping days/hours/minutes it would be possible (however unlikely) that I might generate the same time stamp twice which is a possibility I would like to avoid.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Nov 4th, 2006, 5:19 AM   #2
Iftikhar
Programmer
 
Iftikhar's Avatar
 
Join Date: Oct 2006
Location: London
Posts: 40
Rep Power: 0 Iftikhar is on a distinguished road
Send a message via MSN to Iftikhar
Yes, It always returns the current server time and I think you are only using one server. So on the current server time stamp will always be unique until unless you have more then one servers and distributed database setup in different regions.
__________________
Iftikhar Ahmed Khan
For doing an experiment on programmer's mood please visit http://uxisfyp1.brunel.ac.uk/cspgiak
Iftikhar is offline   Reply With Quote
Old Nov 4th, 2006, 6:08 PM   #3
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 439
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
Lightbulb

Yes the stamp will be unique 'cause it's only one server. However, if that server is affected by daylight savings time, then it's possible that within certain periods of the year (i.e. when you set the clock back one hour or forward one hour) that I will have overlapping timestamps. No worries though I just modified the code to indicate that difference so as to indicate that it's a DST time stamp or not a DST time stamp. That fix works just as good as I want it to.
// echo date("YmdHisI");
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
way to make a function execute at time 'x' badbasser98 C++ 10 Apr 5th, 2006 8:14 AM
checking file existing time to time, in the same time program do other operation myName C++ 3 Mar 13th, 2006 9:39 PM
Time ChronicCode Java 2 Aug 11th, 2005 3:22 PM
Error messages - time program splitterdevildoll C++ 3 Aug 7th, 2005 8:15 PM
C# Pilot Program Haz Existing Project Development 9 May 2nd, 2005 10:27 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:49 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC