forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


@SYSINFO(WINBOOT)

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Tue Mar 15, 2005 11:04 pm    Post subject: @SYSINFO(WINBOOT) Reply with quote

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
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Mar 16, 2005 7:54 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Mar 16, 2005 8:07 am    Post subject: Reply with quote

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
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Mar 16, 2005 8:09 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Mar 16, 2005 8:19 am    Post subject: Reply with quote

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 Smile

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Thu Mar 17, 2005 1:49 am    Post subject: Reply with quote

Is there a way to convert this to a floating point number?
Back to top
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Thu Mar 17, 2005 10:56 pm    Post subject: Reply with quote

This worked like a charm Very Happy

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 Thumbs Up
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group