[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] DateTimeConvert Problem



PureBytes Links

Trading Reference Links

I am having difficulty with the DateTimeConvert function.  Trying to calculate the number of seconds in a DateTime value.  Hours calculates out fine, but minutes and seconds come back as zero.  Any ideas what is going wrong here?

HourSecs = DateTimeConvert(5, DateTime()) * 3600;
MinSecs = DateTimeConvert(4, DateTime()) * 60;
Secs = DateTimeConvert(3, DateTime());
StartSecs = HourSecs + MinSecs + Secs;
StaticVarSet("StartTime", LastValue(StartSecs));
_TRACE("StartTime is: " + StaticVarGet("StartTime") + " HourSecs is: " + LastValue(HourSecs) + " MinSecs is: " + LastValue(MinSecs) + " Secs is: " + LastValue(Secs) + " StartSecs is: " + StartSecs);
_TRACE("Current DateTime is: " + Now(4));


Trace Results:
[3576] StartTime is: 46800 HourSecs is: 46800 MinSecs is: 0 Secs is: 0 StartSecs is: 46800
[3576] Current DateTime is: 133854
[3576] StartTime is: 46800 HourSecs is: 46800 MinSecs is: 0 Secs is: 0 StartSecs is: 46800
[3576] Current DateTime is: 133854




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/