[Gambas-user] arithmetic operations on dates and times
Jussi Lahtinen
jussi.lahtinen at ...626...
Thu Jun 9 16:26:29 CEST 2011
I'm not sure I understand correctly, but this code adds one year to current
date and prints it.
Print Date(Year(Now) + 1, Month(Date), Day(Now), Hour(Now), Minute(Now),
Second(Now))
But I don't know what is upper limit of accepted year.
Maybe you want to use integer or even long variables instead to hold your
time values.
Jussi
On Thu, Jun 9, 2011 at 05:27, Kevin Fishburne <
kevinfishburne at ...1887...> wrote:
> Alright, I wouldn't bother the list but this is blowing my mind a little
> bit.
>
> The date and time in the game world should start at an arbitrary point
> and be modified by the system clock on the server and a scale value
> ((timebase + timeserver) * timescale = gameworldtime). So if the base
> time starts at the year 1000, the server clock's year is 2011 and the
> time scale is 4 then the game world time should be in the year 12044
> ((1000 + 2011) * 4). The date and time ideally would be treated as a
> single entity so everything is scaled by four proportionally.
>
> How in the world would one do this? It's not really important that the
> client know the actual date, but it does need to know the time. The
> client should be able to add "Timer" to the game world time so it can
> keep an accurate 24-hour time while the player is playing. Basically the
> client would receive the game world time upon authentication, then look
> at "gameworldtime + Timer" to determine what time of day it was until
> the player stopped playing.
>
> I noticed that adding and subtracting to a date or time prints a
> floating point number, but multiplying or dividing complains about
> expected datatypes. Any insight or outright solutions would bring light
> and dark to the world. :)
>
> --
> Kevin Fishburne
> Eight Virtues
> www: http://sales.eightvirtues.com
> e-mail: sales at ...1887...
> phone: (770) 853-6271
>
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list