473,320 Members | 2,097 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,320 software developers and data experts.

question about GMT and UTC

Hello,

I need a timezone to store timestamps in that is independent of daylight
saving. From everything I've read, it seems I want either GMT or UTC.
The only problem is I can't figure out from any documentation I've read
if there is any difference (practically speaking, not scientifically and
taking into account the earth's orbit etc).

I can set my server timezone to GMT, but if I want UTC I will have to
use putenv('TZ=UTC'). Could someone please confirm if they are in fact
the same or if one is better, and if I am correct in stating that
neither is affected by daylight saving? Lastly, if I set my server to
GMT (or UTC for that matter), am I also correct in saying that in that
case gmmktime() and gmdate() are the exact same as mktime() and date()?
Thank you very much in advance for your help.
Jul 31 '06 #1
12 2820
Marcus wrote:
Hello,

I need a timezone to store timestamps in that is independent of daylight
saving. From everything I've read, it seems I want either GMT or UTC.
The only problem is I can't figure out from any documentation I've read
if there is any difference (practically speaking, not scientifically and
taking into account the earth's orbit etc).

I can set my server timezone to GMT, but if I want UTC I will have to
use putenv('TZ=UTC'). Could someone please confirm if they are in fact
the same or if one is better, and if I am correct in stating that
neither is affected by daylight saving? Lastly, if I set my server to
GMT (or UTC for that matter), am I also correct in saying that in that
case gmmktime() and gmdate() are the exact same as mktime() and date()?
Thank you very much in advance for your help.
I should elaborate on my first point and ask additionally if a call to:

mktime(12, 0, 0, 5, 10, 2007);

for example, will always return the exact same timestamp in either GMT
or UTC timezone and vice versa, i.e. 1 timestamp resulting in the exact
same 12:00:00 readout via date() whether GMT or UTC. Thanks.
Jul 31 '06 #2
date() returns server time. gmdate returns GMT (UTC) time.

All the dates in my database are stored as GMT/UTC and I display the users local
time onscreen.

Marcus wrote:
Marcus wrote:
>Hello,

I need a timezone to store timestamps in that is independent of
daylight saving. From everything I've read, it seems I want either
GMT or UTC. The only problem is I can't figure out from any
documentation I've read if there is any difference (practically
speaking, not scientifically and taking into account the earth's orbit
etc).

I can set my server timezone to GMT, but if I want UTC I will have to
use putenv('TZ=UTC'). Could someone please confirm if they are in
fact the same or if one is better, and if I am correct in stating that
neither is affected by daylight saving? Lastly, if I set my server to
GMT (or UTC for that matter), am I also correct in saying that in that
case gmmktime() and gmdate() are the exact same as mktime() and
date()? Thank you very much in advance for your help.

I should elaborate on my first point and ask additionally if a call to:

mktime(12, 0, 0, 5, 10, 2007);

for example, will always return the exact same timestamp in either GMT
or UTC timezone and vice versa, i.e. 1 timestamp resulting in the exact
same 12:00:00 readout via date() whether GMT or UTC. Thanks.
Jul 31 '06 #3
Snef wrote:
date() returns server time. gmdate returns GMT (UTC) time.

All the dates in my database are stored as GMT/UTC and I display the
users local time onscreen.
Thanks for the reply. In my initial post I said I was planning on
setting the server time to GMT, so in that case date() and gmdate()
would be the same, yes?

Also, from what you are saying, does that mean there is no difference
between GMT and UTC as far as timestamps are concerned? Thanks.
Jul 31 '06 #4
As far as i have read, UTC is the 'new' GMT. When you see the output of gmdate,
you will see that the result is in UTC.

Snef

Marcus wrote:
Snef wrote:
>date() returns server time. gmdate returns GMT (UTC) time.

All the dates in my database are stored as GMT/UTC and I display the
users local time onscreen.

Thanks for the reply. In my initial post I said I was planning on
setting the server time to GMT, so in that case date() and gmdate()
would be the same, yes?

Also, from what you are saying, does that mean there is no difference
between GMT and UTC as far as timestamps are concerned? Thanks.
Jul 31 '06 #5
Snef wrote:
As far as i have read, UTC is the 'new' GMT. When you see the output of
gmdate, you will see that the result is in UTC.

Snef
Sorry to beat a dead horse here, but from what you are saying and the
documentation I've read, does that mean that the only real difference is
UTC is more accurate in its precision for a timestamp, such as if I want
to know the time right now it might be slightly more accurate to the
"official" time?

In other words, if I just want a representation for May 5, 2007 at 12:00
pm (or any other future time), are GMT and UTC identical and just as
good as each other? (i.e. I don't care if it reports this exact moment
in time as 1 microsecond off of whatever the atomic clock says, I just
want a reliable way of representing various future points in time via
timestamps that aren't affected by daylight saving).

Thanks.
Jul 31 '06 #6
as far as I understand (and use): yes

Marcus wrote:
Snef wrote:
>As far as i have read, UTC is the 'new' GMT. When you see the output
of gmdate, you will see that the result is in UTC.

Snef

Sorry to beat a dead horse here, but from what you are saying and the
documentation I've read, does that mean that the only real difference is
UTC is more accurate in its precision for a timestamp, such as if I want
to know the time right now it might be slightly more accurate to the
"official" time?

In other words, if I just want a representation for May 5, 2007 at 12:00
pm (or any other future time), are GMT and UTC identical and just as
good as each other? (i.e. I don't care if it reports this exact moment
in time as 1 microsecond off of whatever the atomic clock says, I just
want a reliable way of representing various future points in time via
timestamps that aren't affected by daylight saving).

Thanks.
Jul 31 '06 #7
Marcus wrote:
Snef wrote:
>As far as i have read, UTC is the 'new' GMT. When you see the output
of gmdate, you will see that the result is in UTC.

Snef

Sorry to beat a dead horse here, but from what you are saying and the
documentation I've read, does that mean that the only real difference is
UTC is more accurate in its precision for a timestamp, such as if I want
to know the time right now it might be slightly more accurate to the
"official" time?

In other words, if I just want a representation for May 5, 2007 at 12:00
pm (or any other future time), are GMT and UTC identical and just as
good as each other? (i.e. I don't care if it reports this exact moment
in time as 1 microsecond off of whatever the atomic clock says, I just
want a reliable way of representing various future points in time via
timestamps that aren't affected by daylight saving).

Thanks.
Try a little search:

http://en.wikipedia.org/wiki/Coordinated_Universal_Time

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Aug 1 '06 #8
In article <f9******************************@insightbb.com> , JumpMan222
@aol.com says...
it seems I want either GMT or UTC.
The only problem is I can't figure out from any documentation I've read
if there is any difference
GMT is the obsolete name. The Greenwich observatory has been out
of the role of an official clock source for a long time.

UTC (Universal Coordinated Time) is the shorthand name for the
modern reference time at the prime meridian.

So, use UTC as the designation for your timezone reference.

The US military (and probably NATO) likes to call the
zero-offset timezone "zulu time", just to confuse everyone...

And another good practice is to use numerical offsets for
timezones instead of the 3-letter names. For example, saying
"EST" is confusing because it means something different
in Canada compared to the US. When control of timezone rules
remain in the hands of politicians, don't hard-code any assumptions.

Bob Devine
Aug 1 '06 #9
Jerry Stuckle wrote:
>
Try a little search:

http://en.wikipedia.org/wiki/Coordinated_Universal_Time
I actually read that entire page and spent the last 2 days googling but
never answered my question definitively. I only post to the newsgroup
after I exhaust all my search options and still am not sure.
Aug 1 '06 #10
Marcus wrote:
Jerry Stuckle wrote:
>>
Try a little search:

http://en.wikipedia.org/wiki/Coordinated_Universal_Time

I actually read that entire page and spent the last 2 days googling but
never answered my question definitively. I only post to the newsgroup
after I exhaust all my search options and still am not sure.
From the start:

"Coordinated Universal Time (UTC) is a high-precision atomic time
standard which replaced Greenwich Mean Time on 1 January, 1972..."

So, officially GMT is no more, and UTC is king. Of course, Greenwich,
England still has a time zone, and it is the same as UTC - at least
until they start observing daylight savings time.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Aug 1 '06 #11
Jerry Stuckle wrote:
So, officially GMT is no more, and UTC is king. Of course, Greenwich,
England still has a time zone, and it is the same as UTC - at least
until they start observing daylight savings time.

Thank you, this one line cleared it up for me.
Aug 1 '06 #12
Marcus <Ju********@aol.comwrote:
Also, from what you are saying, does that mean there is no difference
between GMT and UTC as far as timestamps are concerned? Thanks.
Yes, for all practical web-development purposes they are synonyms.

miguel
--
Photos from 40 countries on 5 continents: http://travel.u.nu
Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
Airports of the world: http://airport.u.nu
Aug 1 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from...
3
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.