| View previous topic :: View next topic |
| Author |
Message |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Tue Mar 15, 2005 11:04 pm Post subject: @SYSINFO(WINBOOT) |
|
|
1. Why does @SYSINFO(WINBOOT) tack an AM or PM to the end of the result? (IE. 40:22:12:43 PM ) I assume that this means 40 Days 22 Hours 12 Minutes and 43 Seconds... Not sure what the PM is for.
2. Has anyone written a routine that will add/subtract time from the current datetime?
What I'm trying to do is subtract the result of @SYSINFO(WINBOOT) from the current datetime to get the datetime that the system was last booted. |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Mar 16, 2005 7:54 am Post subject: |
|
|
AM and PM are used in some countries that use 12 hour time eg. Australia
AM refers to the mornin and PM to the afternoon
so 2:30PM is 2:30 in the afternoon or 14:40 in 24 hour time
i came across the same observation when i looked at @SYSINFO(WINBOOT) and like you could not work out why it was there - i concluded that it was there by error as i could not see any rational to include AM or PM to the string returned
serge _________________
|
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Mar 16, 2005 8:07 am Post subject: |
|
|
TimeDate.dll can do those types of calculations...
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Wed Mar 16, 2005 8:09 am Post subject: |
|
|
Yes, it appears to use a time conversion routine that uses the Windows time format setting to determine the output format.
It seems to me it would be better for it to return the value as a floating point number of days. Then you could do math on it, or use @datetime() to format it whichever way you want it. Thoughts? _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Mar 16, 2005 8:19 am Post subject: |
|
|
| Quote: | | It seems to me it would be better for it to return the value as a floating point number of days. Then you could do math on it, or use @datetime() to format it whichever way you want it. Thoughts? |
great idea jules
serge _________________
|
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Thu Mar 17, 2005 1:49 am Post subject: |
|
|
| Is there a way to convert this to a floating point number? |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Thu Mar 17, 2005 10:56 pm Post subject: |
|
|
This worked like a charm
| Code: | %%LastBoot = @datetime(ddddd tt,@TimeDate(IncTime,msecs,-@timedate(uptime),@datetime(yyyy),@datetime(m),@datetime(d),@datetime(h),@datetime(n),@datetime(s),0))
|
Thanks Dread  |
|
| Back to top |
|
 |
|