From Fedora Project Wiki

fp-wiki>ImportUser
(Imported from MoinMoin)
 
m (Cleanup (what is with those <pre> tags?))
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<!-- Do not remove
{{header|infra}}
-->
<!-- StartHeader
-->
<pre>#!html
<div style="height:66px; width:100%; background-color:#002867;">
<a href = "http://fedoraproject.org/wiki/Infrastructure"> <img style="float:right;padding-top:3px;" src="http://fedoraproject.org/wiki/Infrastructure?action=AttachFile&do=get&target=InfrastructureTeamN1.png" /></a>
</div>
 
<HR style="height:2px; background-color:#00578E;" />
</pre>
<!-- EndHeader
-->


= UTC Howto =
= UTC Howto =


== What is UTC? ==
== What is UTC? ==
Line 31: Line 17:
There are several ways:
There are several ways:


1. Do mental arithmetic. You need to know the offset of you timezone and add it to UTC. A table with some timezone offsets is below.
# Do mental arithmetic. You need to know the offset of you timezone and add it to UTC. A table with some timezone offsets is below.
1. You can use the commandline tool ''date'' for this. This only works when you use a machine that is configured to display your timezone.<pre>
# You can use the commandline tool ''date'' for this. This only works when you use a machine that is configured to display your timezone. <pre>$ date -d '2007-06-07 04:00 UTC'
$ date -d '2007-06-07 04:00 UTC'
Thu Jun  7 00:00:00 EDT 2007
Do 7. Jun 06:00:00 CEST 2007
</pre>
</pre>
1. You can use an [http://www.timeanddate.com/worldclock/converter.html online time calculator]  
# You can use an [http://www.timeanddate.com/worldclock/converter.html online time calculator]  


== How can I convert my/any localtime into UTC? ==
== How can I convert my/any localtime into UTC? ==
1. Do mental arithmetic. You only need to substract the offset of your timezone from your localtime to get UTC. A table with some timezone offsets is below.
# Do mental arithmetic. You only need to substract the offset of your timezone from your localtime to get UTC. A table with some timezone offsets is below.
1. You can use the commandline tool ''date'' for this.<pre>
# You can use the commandline tool ''date'' for this. <pre>$ date -u -d "2007-06-07 00:00 EDT" +"%Y-%m-%d %H:%M %Z" # this converts a given time to UTC
$ date -u -d "2007-06-07 00:00 EDT" +"%Y-%m-%d %H:%M %Z" # this converts a given time to UTC
2007-06-07 04:06 UTC
2007-06-07 04:06 UTC
$ date -u +"%Y-%m-%d %H:%m %Z" # this display the current time in UTC
$ date -u +"%Y-%m-%d %H:%m %Z" # this display the current time in UTC
2007-06-29 20:06 UTC
2007-06-29 20:06 UTC</pre>
</pre>
# You can use the graphical tool ''international-time'': <pre>$ international-time</pre>
1. You can use the graphical tool ''international-time'':<pre>
# You can use an [http://www.timeanddate.com/worldclock/converter.html online time calculator]  
$ international-time
</pre>
1. You can use an [http://www.timeanddate.com/worldclock/converter.html online time calculator]  


== Table of timezones ==
== Table of timezones ==
Line 61: Line 42:
|}
|}


----
[[Category:Infrastructure]]
[[Category:Infrastructure]]

Revision as of 21:34, 25 May 2008


UTC Howto

What is UTC?

Coordinated Universal Time (UTC) is the official world time. Your local time is this world time plus or minus an offset. For most timezones this offset is an multiple of an hour. Typical dates in UTC look like these:

2007-06-07 04:00 UTC
2007-06-07 04:00 +0000
2007-06-07T04:00UTC

You can find a long article about UTC at Wikipedia .

How can I convert UTC into localtime?

There are several ways:

  1. Do mental arithmetic. You need to know the offset of you timezone and add it to UTC. A table with some timezone offsets is below.
  2. You can use the commandline tool date for this. This only works when you use a machine that is configured to display your timezone.
    $ date -d '2007-06-07 04:00 UTC'

Thu Jun 7 00:00:00 EDT 2007

  1. You can use an online time calculator

How can I convert my/any localtime into UTC?

  1. Do mental arithmetic. You only need to substract the offset of your timezone from your localtime to get UTC. A table with some timezone offsets is below.
  2. You can use the commandline tool date for this.
    $ date -u -d "2007-06-07 00:00 EDT" +"%Y-%m-%d %H:%M %Z" # this converts a given time to UTC

2007-06-07 04:06 UTC $ date -u +"%Y-%m-%d %H:%m %Z" # this display the current time in UTC 2007-06-29 20:06 UTC

  1. You can use the graphical tool international-time:
    $ international-time
  2. You can use an online time calculator

Table of timezones

EDT US/Eastern Daylight Time New York -0400 2007-06-07 00:00 EDT
CET Central European Time Berlin +0100 2007-06-07 05:00 CET
CEST Central European Summer Time Berlin +0200 2007-06-07 05:00 CEST