Normal Topic @Time Value (Read 1111 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
@Time Value
Sep 28th, 2011 at 6:14am
Print Post Print Post  
Currently when I use @Time function, it gives me value in 24 hour clock. e.g.  14.52.  How can I get value with the seconds using @Time, that is current time?  e.g. 14:52:36 CST
  
Back to top
 
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: @Time Value
Reply #1 - Sep 28th, 2011 at 10:28am
Print Post Print Post  
Hello Bharat,

Did you try @ServerTime?
  
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: @Time Value
Reply #2 - Sep 28th, 2011 at 10:44am
Print Post Print Post  
Hallo!
you can use @servertime() function.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @Time Value
Reply #3 - Sep 28th, 2011 at 1:37pm
Print Post Print Post  
Thanks Tcgeo and Amor. With @ServerTime ( ), I got the value with seconds. For timezone, I can always add a string.

var vTimeSent as String

vTimeSent = @ServerTime ( )
vTimeSent = vTimeSent + " CST"


Thanks again guys.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @Time Value
Reply #4 - Sep 28th, 2011 at 7:44pm
Print Post Print Post  
I need to have time converted to GMT. The problem is our time changes in fall and spring. Is there an easy solution for this?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @Time Value
Reply #5 - Sep 28th, 2011 at 7:57pm
Print Post Print Post  
Bharat_Naik wrote on Sep 28th, 2011 at 7:44pm:
I need to have time converted to GMT. The problem is our time changes in fall and spring. Is there an easy solution for this?

You can put your area's switchover dates into GlobalValues and check them when figuring out how many hours to add/subtract.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @Time Value
Reply #6 - Sep 28th, 2011 at 8:16pm
Print Post Print Post  
Bharat_Naik wrote on Sep 28th, 2011 at 7:44pm:
I need to have time converted to GMT. The problem is our time changes in fall and spring. Is there an easy solution for this?


Windows, unfortunately, does not seem to have a single command for this purpose (Unix does). But you can derive the information from the systeminfo command:
Code
Select All
var aa as string
var bb as int

aa = @RedirectProcess("systeminfo", "")
bb = @InStr(aa, "GMT")
aa = @Mid(aa, bb + 3, 6)
writeln(aa)

 



This should tell you how many hours off (positive or negative) you are from GMT. I am in EDT and I get "-05:00". So if I add five hours to my current time, I get GMT. Be forewarned, because it is used for a few dozen other purposes, the "systeminfo" command isn't about to break any speed records.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @Time Value
Reply #7 - Sep 28th, 2011 at 8:32pm
Print Post Print Post  
Thanks Mark. Very interesting and clever!! I see you picked this from following line in from the systeminfo command at the prompt:

Time Zone:                 (GMT-06:00) Central Time (US & Canada)

Now I will have to just change the date forward if hours goes over 24.

Thanks again.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @Time Value
Reply #8 - Sep 28th, 2011 at 8:49pm
Print Post Print Post  
It is good that now I will not have to prepare the following table. Since the dates for change of time is not constant and again the time changes at 2.00am and date changes forward if the time goes over 24.00 hour, it would have been quite daunting to take everything into account.

Calendar Year      DST Starts/Begins      DST Stops/Ends
2009      March 8      November 1
2010      March 14      November 7
2011      March 13      November 6
2012      March 11      November 4
2013      March 10      November 3
2014      March 9      November 2
2015      March 8      November 1
2016      March 13      November 6

Thanks Mark for the solution.
  
Back to top
 
IP Logged