f



How do I get time in another time zone ??

I'm in the UK using British Summer Time (BST). I'd like to get the time 
in New York (EDT). I believe there is an option to 'clock' to change the 
time zone, but any combination I try gives the wrong result.

This is what I have:


set foobar  [clock format [clock seconds]]


Ideally, I'd like to get the time in this format:


Sun Oct 19  17:38:07 EDT  (New York time)

I can obviously add '(New York time)'. Any suggestions how I can get the 
time in the EDT timezone, and ideally in the format shown.

dave


0
foo25 (218)
10/19/2008 9:40:35 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

1 Replies
669 Views

Similar Articles

[PageSpeed] 52

Dave wrote:
> I'm in the UK using British Summer Time (BST). I'd like to get the time 
> in New York (EDT). I believe there is an option to 'clock' to change the 
> time zone, but any combination I try gives the wrong result.

You most likely want something like:

clock format [clock seconds] -format "%x %X %Z" \
     -timezone :America/New_York -locale en_US

You'll notice that -locale deals with punctuation differences (and
details like month-first vs. day-of-month-first), while -timezone
deals specifically with time zone.

-locale and -timezone need Tcl 8.5 or later. If you're stuck
on 8.4, you can either play games with $env(TZ) or get the
'newclock' extension.

-- 
73 de ke9tv/2, Kevin
0
kennykb (564)
10/19/2008 10:36:51 PM
Reply:

Similar Artilces:

time.clock() or time.time()
What's the difference between time.clock() and time.time() (and please don't say clock() is the CPU clock and time() is the actual time because that doesn't help me at all :) I'm trying to benchmark some function calls for Zope project and when I use t0=time.clock(); foo(); print time.clock()-t0 I get much smaller values than when I use time.clock() (most of them 0.0 but some 0.01) When I use time.time() I get values like 0.0133562088013, 0.00669002532959 etc. To me it looks like time.time() gives a better measure (at least from a statistical practical point of view). peterbe@gmail.com wrote: > What's the difference between time.clock() and time.time() > (and please don't say clock() is the CPU clock and time() is the actual > time because that doesn't help me at all :) > > I'm trying to benchmark some function calls for Zope project and when I > use t0=time.clock(); foo(); print time.clock()-t0 > I get much smaller values than when I use time.clock() (most of them > 0.0 but some 0.01) > When I use time.time() I get values like 0.0133562088013, > 0.00669002532959 etc. > To me it looks like time.time() gives a better measure (at least from a > statistical practical point of view). time.time() is very likely what you want. time.time() measures real time, while time.clock() measures the time the CPU dedicates to your program. For example, if your function spends 2 seconds doing pure I/O and 3 seconds do...

time.time or time.clock
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the following to try to determine which. import time # Determine if time.time is better than time.clock # The one with better resolution should be lower. if time.clock() - time.clock() < time.time() - time.time(): clock = time.clock else: clock = time.time Will this work most of the time, or is there something better? Ron On Jan 14, 7:05 am, Ron Ad...

time.time()
am I doing this wrong: print (time.time() / 60) / 60 #time.time has been running for many hours if time.time() was (21600/60) then that would equal 360/60 which would be 6, but I'm not getting 6 so I'm not doing the division right, any tips? On Sat, 24 Jan 2004 13:01:40 -0500, Bart Nessux <bart_nessux@hotmail.com> wrote: >am I doing this wrong: > >print (time.time() / 60) / 60 #time.time has been running for many hours > >if time.time() was (21600/60) then that would equal 360/60 which would >be 6, but I'm not getting 6 so I'm not doing the divisi...

time zones, posix time
We have a 928, 7.5, set for local time (GMT-10). Mpe tells me time and date fine., eg Oct 15, 15:50 hrs. Posix gives me Sept 5, 21:05 ---?? whole hours out I can understand, but 45 minutes? I have tried several TZ setting, but cant get anywhere near reality. Why would the date be out??? env in posix shows all the HP variables, same values as in mpe shell. tia, John * To join/leave the list, search archives, change list settings, * * etc., please visit http://raven.utc.edu/archives/hp3000-l.html * ...

Time zone and time(t)
Configuration: Windows 2000 & Regina REXX (3.3, 3.5, & 3.7) Somewhere from Regina 3.3 to 3.5 a change was made to the TIME function which is causing me a problem. I believe it's a feature, not a bug. If it is a feature, I'd like to know how best to work around it. Time(t) is, and apparently always was, UTC time. However, in 3.3, converting time(t) to time(n), it converted back to local time. In 3.5 & 3.7, converting it back to time(n) leaves it in UTC. I'd like to be able to do some time/date arithmetic using time(t) and display the result in local time. Here is an example and the output as run in 3.3 and 3.7: <code> numeric digits 12 parse version b say b say time('n') a = time('t') say a say time('n',a,'t') say time('n',a+2,'t') </code> 3.3 output: REXX-Regina_3.3(MT) 5.00 25 Apr 2004 17:24:08 1355955848 17:24:08 17:24:10 3.7 output: REXX-Regina_3.7(MT) 5.00 14 Oct 2012 17:24:08 1355955848 22:24:08 22:24:10 The reason I want to use time(t) is that it's the only format that easily allows for arithmetic that could span one or more midnight boundaries. I'd hard-code my time offset, but I don't want to have remember to change the code twice a year. So, assuming this is working as designed, how am I best able to display current, local time converted from a time(t) time? Is there a simple way...

RE: Is time.time() < time.time() always true?
Chris Mellon wrote: > On 21 Nov 2006 15:10:25 -0800, flamesrock <flamesrock@gmail.com> > wrote:=20 >> So, I was blazin' some mad chronix, as they say, and got on to >> thinking about Python.=20 >>=20 >> The question was, is the statement: >>=20 >> time.time() < time.time() >>=20 >> always true? Seems it should be false, since the statement itself >> occurs at one time instant.. but of course we know that python >> doesn't execute code that way.. So my question is, why doesn't >> Python work this way?=...

time in milliseconds by calling time.time()
I am trying to measure some system response time by using the time.time () or time.clock() in my script. However, the numbers I get are in 10s of milliseconds. For example, 1248481670.34 #from time.time() 0.08 #from time.clock() That won't work for me, since the response time may be only a few milliseconds. My environment is Solaris 10 with Python 2.4.4 (#7, Feb 9 2007, 22:10:21). SunOS 5.10 Generic_137112-07 i86pc i386 i86pc The tricky thing is, if I run the python interpreter and import the time module, I can get a time floating number in better precision by cal...

Calculating Elapsed Time between Time Zones
Hello, I am attempting to calculate the elapsed time when a plane takes off in one time zone and lands in another. I had thought the proper approach was to simply set both times to the number of minutes since midnight GMT and subtract the smaller from the larger.... However this leads to some interesting permutations. For example: A plane leaves LAX at 1:25 and touches down in Atlanta at 8:34. Converting the times to their GMT equivalents results in an LAX departure time of -375 minutes. Similarly, converting the departure time of a flight from Tokyo to JFK results in a departure tim...

Time zone objects and time change
Looking at time zone object QN0800U on our V5R3 system, it says that daylight saving time ends on the last Sunday in October. However, I think it actually ends on the first Sunday in November this year. Is there a way to refresh the time zone objects so they show correct stop and start dates for DST? Jonathan Ball wrote: > Looking at time zone object QN0800U on our V5R3 system, it says that > daylight saving time ends on the last Sunday in October. However, I > think it actually ends on the first Sunday in November this year. > > Is there a way to refresh the time zone...

Get time event at a specific time
Hi! Is it possible to get a time event at a specific time, for instance eight a'clock? My program is running in the background and is minimized to the tray bar. If not, is there a smooth way to accomplish this in a different way? Best regards, Andreas Lundgren "Andreas" <d99alu@efd.lth.se> wrote in message news:f7cd4365.0310022357.75ec4f66@posting.google.com... > Hi! > > Is it possible to get a time event at a specific time, for instance > eight a'clock? My program is running in the background and is > minimized to the tray bar. > > If not, is there a smooth way to accomplish this in a different way? > > Best regards, > Andreas Lundgren Just put a timer control on the form and set it to fire every second. Somewhere in the code you set your target: Dim Target As Date Target = "10/4/2003 8:00 PM" And in the timer code you check for this target: Private Sub Timer1_Timer() If Now => Target Then ' fire the event that you need to happen at the target time End If End Sub On Fri, 03 Oct 2003 08:57:08 GMT, "Raoul Watson" <WatsonR@IntelligenCIA.com> wrote: > >"Andreas" <d99alu@efd.lth.se> wrote in message >news:f7cd4365.0310022357.75ec4f66@posting.google.com... >> Hi! >> >> Is it possible to get a time event at a specific time, for instance >> eight a'clock? My program is running in the background and is >> min...

I look for a list to convert time zone abbreviation to full time zone in python
Hi, I would like to convert time zone abbreviation to full time zone in Python. I've found this information : * http://stackoverflow.com/questions/1703546/parsing-date-time-string-with-timezone-abbreviated-name-in-python I'm currently writing dict with this informations : http://www.timeanddate.com/library/abbreviations/timezones/ Questions : * are there the same list somewhere (I didn't found in pytz) ? * is it possible to append this list in pytz or in standard python date module ? Best regards, Stephane -- St�phane Klein <contact@stephane-klein.inf...

time manipulation getting invalid times
I have a script that deals with time in hours, minures, seconds and milliconds. Initially I was using the round function from Math::Round It was working fine then I noticed I was getting an error occasionaly. Turned out it was when the seconds were 59 and the milliseconds were above 500, I was rounding the minutes from 59 to 60 yeilding invalid times like 13 minutes and 60 seconds instead of 14 minutes and 00 seconds. Example: HH:MM:SS,miliseconds $lines[0] = 00:13:59,934 my $roundedSeconds = sprintf("%02d",(round(substr($lines[0],-6)))); Using the round function from Math...

time module question
I tend to deal with dates a lot in different formats and places... typically I'll convert them to a time tuple with strptime(), and pass them around like that before I need to write them back out. One set of time/dates I'm getting are in UTC, but the string doesn't say that specifically. So I do this.. I had expected the outcome to be offset properly (I'm EST5EDT). But I'm obviously missing something: #!/usr/bin/env python import time utc_str = '2008-05-10 03:05:00 UTC' d = time.strptime(utc_str,'%Y-%m-%d %H:%M:%S %Z') t = time.mktime(d) print d pri...

Displaying time in different time zones
(yes, another timezone question...) I'm trying to get to grips with times, and as an exercise am trying to create a function to display the time in various places. The way I'm currently doing this is as follows: // ------------------------------- putenv("TZ=GMT"); //set to GMT $time_to_convert = mktime(15,0,0); //gives me 3pm GMT echo(strftime('%d/%m/%y %H:%M',$time_to_convert)); //3pm putenv("TZ=CET"); echo(strftime('%d/%m/%y %H:%M',$time_to_convert)); //7pm // ------------------------------- That seems to work fine, and gives me the dates in ...

Time Stamped entries and Time Zones
Currently I am working for a company with our computer located in our corporate headquarters in Edina MN. We have 15 sales locations in 5 states (Minnesota, Iowa, Nebraska, Missouri and Kansas). We have a very simple time-clock system. Run a program, press a function key that says you are clocking in (or out) and the program captures the date and time of this entry. A sales person in Nebraska can look at notes on a prospective customer and see that 5 minutes ago a call was placed from our call center in Minnesota to this customer and an appointment was setup for that after...

cookie expire time and time zones
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone here put me straight on the following: I had a look at the time() function came across this: "To clarify, it seems this function returns the time of the computer's clock and does not do any timezone adjustments to return GMT, so you are given the local time. The description says that it's supposed to return the number of seconds from 1970 12am GMT, when the seconds are actually counted from 12am in the computer's local time. Hope it saves some confusion. " This seems to be saying that the time() function retreaves the date in seconds from 1970 12a.m from the users pc clock. This is great for me, it means I don't need to worry about time zones. My cookie will expire in 60seconds (time() + 60) regardless of where the user lives. Have I interpreted things correctly? thanks David David Graham wrote on 20 Nov 2003: > Hi > I have asked this question in alt.php as the time() function as > used in setcookie belongs to php - or does it belong equally in > the javascript camp - bit confused about that. Anyway, can > anyone here put me straight on the following: > > I had a look at the time() function came across this: > > "To clarify, it seems this function returns the time of the > computer's clock and does not do a...

Getting the Date and Time From a Time Server
Hello everyone, Is there a way to use the Import function to grab the current date and time from a time server on the Internet? Regards, Gregory Maybe you could run the "ntpdate" program external and retreive the time offset between your computer clock and the time server. (in the following example, the time server is only good in canada) Run["ntpdate -q time.chu.nrc.ca >/tmp/toto"] res=Import["/tmp/toto", "Table","FieldSeparators" -> {" ", ","}] offset=res[[1,6]] (* not very portable... :-( *...

delta time = time stop
I'm using Python to parse a bunch of s/w test files and make csv files for later report generation by MS ACCESS....(my boss loves the quick turn-around compared to C). Each log file may contain one or more 'sessions', and each session may contain one or more 'nodes'. Each session in the log has an ASCII start and stop time, as does each node. I have the basic parse part done for parameters, errors, etc., but noticed my routine for determining how long each session/node took (delta time) was a bit repetitive, so decided to make a 'stand-alone' routine to handle th...

How to get simulink simulation time to be the same as actual time.
Hello everyone, I am using trying to use simulink as a controller for an experiment using a data acquisition board to read in instrument signals and send out command signals real time. I am having a few issues and I believe that all of these could be resolved if I could just get the simulation time to be real time. What I mean is that if I use a fixed time step of .01 seconds and have a simulation time of 10 seconds then I want the simulation to last 10 seconds and have a delay of .01 seconds between each time step. Is there a way to do this or is there a tutorial I should read for how t...

Getting millisecond-precision time out of a Time object?
Is there any way to get a millisecond-precision time (hh:mm:ss.sss) out of a Time object? Time class's toString() method only returns the time at one-second precision (hh:mm:ss), which is not accurate enough for my purposes. -- -Aki "Sus" Laukkanen On Wed, 03 Nov 2004 17:48:21 +0200, Aki "Sus" Laukkanen wrote: > Is there any way to get a millisecond-precision time (hh:mm:ss.sss) > out of a Time object? ...errr. Are you referring to java.sql.Time? It's super-class, java.util.Date, has getTime() that provides msec. HTH -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane > which is not accurate enough for my purposes. I don't know how deep you want to go into precision, but just a hint: Windows system time quant is 50ms, this is the smallest quant you can get any *real* results. Below that you are getting the bogus = (myTime mod 50) + a spice from the floating part of the number (to do not show all zeros at the end every time). I don't know about the quant on Unix and Mac, but is also *definitely* not 1ms and of course not 1ns (And I saw some guys seriously extending default stuff to work with picosecs, which is really... sad). On Wed, 3 Nov 2004 18:09:56 +0100, VK wrote: > (And I saw some guys seriously extending default stuff to work ...

time adjustment code according to time zone
Hi, everyone Is there any C open source for time adjustment according to time zone? Thanks advance. Best Regards, J.Hwan Kim J.H.Kim wrote: > Hi, everyone > > Is there any C open source for time adjustment according to time zone? localtime() ? On 2011년 10월 25일 00:29, Joachim Schmitz wrote: > J.H.Kim wrote: >> Hi, everyone >> >> Is there any C open source for time adjustment according to time zone? > > localtime() ? But, I'm using now AVR compiler not for PC, so localtime() function cannot be supported. I need the raw C code. On 10/24/2011 11:0...

using time.gov to get the current time
Is there any way to get the current time from time.gov using urllib2 or som= ething similar? Does anyone have any examples of doing this? Thanks! Rick King Southfield MI ...

Time zone and 24 hours time format
Hi, What time zones tend to use 24 hours time format? Googling hasn't been able to answer the question. Thank you. On Tue, 16 Oct 2007 22:25:56 +0200, <tatata9999@gmail.com> wrote: > What time zones tend to use 24 hours time format? Googling hasn't > been able to answer the question. Outside the USA, almost everyone. Haven't got a full list though. -- Rik Wasmus tatata9999@gmail.com wrote: > Hi, > > What time zones tend to use 24 hours time format? Googling hasn't > been able to answer the question. Time format preferences...

Multi-time zone date/time value?
If I have a class that wishes to store a date/time value that is valid across multiple time zones what data members should I add? "davout" <davZZZYYYXXXout@dial.pipex.com> writes: > If I have a class that wishes to store a date/time value that is valid > across multiple time zones what data members should I add? A simple long. And get the data from java.util.Date.getTime(). If you don't have messed up you computer clock, you get GMT (UTC) based date/time data that does not depend on timezones or DST. /Thomas davout wrote: > If I have a class that wishes to st...

Web resources about - How do I get time in another time zone ?? - comp.lang.tcl

John Legend beefs with Donald Trump Jr., calls Donald Trump Sr. a ‘racist’
Controversial opinion: I honestly think Chrissy Teigen needs to take two steps away from her social media accounts, because she has a hair-trigger ...

1 Killed; 2 Others Presumed Dead in NY Tugboat Crash
A search for two missing crew members of a tugboat that crashed into a barge and sank in the Hudson River has stretched into another day

ABC Four Corners team arrested in Malaysia over reporting on corruption allegations
An ABC Four Corners crew is detained by Malaysian police after trying to question Prime Minister Najib Razak over a corruption scandal.

Nickelodeon’s 2016 Kids’ Choice Awards
Show host Blake Shelton is ‘slimed’ during Nickelodeon’s 2016 Kids’ Choice Awards in Inglewood, California. — Reuters pic

Officials say unrest at prison in Alabama leaves 2 hurt
Inmates set a fire, seized control of a dormitory and stabbed two corrections officials during a violent uprising at a prison in southern Alabama, ...

Why daylight saving time is so controversial
WITN Why daylight saving time is so controversial WITN It's that time of year again. On Sunday, most residents in the U.S., Europe, and several ...

AlphaGo’s victory means the world is about to change
This weekend, the world’s greatest Go player beat Google’s AlphaGo , an AI program developed by Google’s DeepMind unit. Lee Se-dol, the 33-year-old ...

Germanwings Crash: BEA Investigators Urge New Rules About Reporting Mental-Health Concerns
NBCNews.com Germanwings Crash: BEA Investigators Urge New Rules About Reporting Mental-Health Concerns NBCNews.com LE BOURGET, France — Air ...

Unusually widespread flooding across Louisiana, Mississippi
HATTIESBURG, Miss. (AP) — As the Leaf River rose north of Hattiesburg, Mississippi, 26-year-old Rebecca Bruce and her fiancé grabbed what they ...

Fans chant 'You killed Jesus' during high school basketball game
Officials at Catholic Memorial School apologize after some students chant anti-Semitic taunts during a basketball game against a school with ...

Resources last updated: 3/13/2016 12:18:08 PM