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 


DateTime confusion...

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


Joined: 19 Oct 2001
Posts: 104

PostPosted: Mon Mar 21, 2005 1:57 pm    Post subject: DateTime confusion... Reply with quote

Im using VDS4 if this makes a difference.

This program I'm creating inserts a task into the Windows task scheduler on the next day. So I need to add a day to the current date. I know with @datetime() I can get a floating point number, but how can I add a number to it and get a date back out?

I realize that I could probably use datetime.dll, but if its simple enough to do, I'd like to avoid that.

Thanks for your awesome help as usual guys.
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Mar 21, 2005 2:41 pm    Post subject: Reply with quote

as i understand it, when vds returns a date as a decimal then the integer part deals with the date while the decimal deals with the time

eg. 2345.6789 would have 2345 dealing with the date, so adding 1 to it will give you the next day's date, and .6789 deals with the time

serge

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


Joined: 19 Oct 2001
Posts: 104

PostPosted: Mon Mar 21, 2005 2:45 pm    Post subject: Reply with quote

Yes, but how to I get that number back into a date format, like 3/21/05?
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Mar 21, 2005 2:49 pm    Post subject: Reply with quote

@datetime(dd/mm/yy,234.5678) should do it

serge

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


Joined: 19 Oct 2001
Posts: 104

PostPosted: Mon Mar 21, 2005 3:24 pm    Post subject: Reply with quote

Similar problem...

I need to add 2 minutes to the time. Is there a breakdown of what floating point number is the minutes in @datetime()?

BTW, thanks TONS for your help.
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Mar 21, 2005 3:40 pm    Post subject: Reply with quote

yes there is, someone posted a while back what the decimal number is for a minute, a second but i don't remember when and where

do a search at the forum and see if you can find it

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jules
Professional Member
Professional Member


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

PostPosted: Mon Mar 21, 2005 4:30 pm    Post subject: Reply with quote

I wonder about you guys sometimes. Wink

A minute is 1 / 24 / 60. You can use the Windows calculator to work it out. Since I can never remember the value I do it all the time.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Mon Mar 21, 2005 4:56 pm    Post subject: Reply with quote

jules wrote:
I wonder about you guys sometimes. Wink

A minute is 1 / 24 / 60. You can use the Windows calculator to work it out. Since I can never remember the value I do it all the time.


Do you really wonder about me when I say that I still don't understand?
Back to top
View user's profile Send private message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Mon Mar 21, 2005 5:37 pm    Post subject: Reply with quote

Flypaper,

1 day = 1.0 in VDS time/date format.

There are 24 hours in a day, so 1 hour = 1 divided by 24.

There are 1440 minutes in a day, or 60 minutes in an hour,
so 1 minute = 1 divided 1440, or 1 divided by 24 divided by 60 (Jules equation).

There are 82400 seconds in a day, so 1 second = 1 divided by 82400,
or 1 divided by 24 divided by 60 divided by 60.

I hope this helps...

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Mon Mar 21, 2005 7:43 pm    Post subject: Reply with quote

That took me a few minutes to wrap my small brain around, but i understand whats going on now. thanks guys!
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Mar 21, 2005 11:11 pm    Post subject: Reply with quote

Quote:
I wonder about you guys sometimes. Wink


i realised about how to work it out after the post when my computer was switched off...can't help it if i am a bit slow sometimes Embarassed

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Mar 21, 2005 11:18 pm    Post subject: Reply with quote

Quote:
Do you really wonder about me when I say that I still don't understand?


flypaper,

i'm afraid that he is talking about me - for a long time i wondered about how long a vds second was a decimal and then it dawned on me after my post above, but it was too late for me to tell you or work it out as i had logged off and switched off my desktop

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Mar 21, 2005 11:45 pm    Post subject: Reply with quote

No offense - but if folks would search the forums, many
questions have been already answered. Wink

This link was posted about @datetime() info over two
years ago:
http://www.vdsworld.com/forum/viewtopic.php?t=919

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
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