![]() ![]() Two: In your example, you subtracted instead of to get around the fact that the maximum precision for first qualifier of an INTERVAL is 9. In this case it doesn't look like we do, however having an answer in milliseconds gives you flexibility you don't have with an answer in seconds. Might be worth checking if we lose anything by returning seconds and not milliseconds. One: The Java routine returns answer in milliseconds, whereas the new util.Datetime methods that are being added to 4gl return an answer in seconds. would've got you what you wanted as well (although I prefer a 4gl solution where possible). Seen as you already had found a method in Java that did what you want, I'll point out that. Note also that there is a more elegant whay to define the year 2000 datetime value (d2000), by using a CONSTANT:ĬONSTANT d2000 DATETIME YEAR TO DAY = DATETIME() YEAR TO DAY In fact in BDL 2.51, we have added fromSecondsSinceEpoch / toSecondsSinceEpoch methods. I just realized that the UTC conversion methods are already available in 2.50. As described in the link below, we need the current time, in milliseconds to generate the access token. We need this "timestamp" for our e-mail client, Zimbra, pre-authentication process. Thanks for your reply! This solution worked perfectly. ![]() LET ms_2000_now = (tmp.subString(1,10)*1000) + tmp.subString(12,14)Ĭan we have more detais about what you want to do with the current UTC date/time in milliseconds? Converts a datetime to milliseconds since epochĬONSTANT ms_1970_2000 BIGINT = 946684800000 - milliseconds from to ĭEFINE d2000 DATETIME YEAR TO FRACTION(3)ĭEFINE sec_2000_now INTERVAL SECOND(9) TO FRACTION(3) You will have to wait for the next major version of Genero to get UTC to local TZ datetime conversion functions, for now it's only available in the BDL 2.51 version that ships with Genero Mobile V1: You could compute the duration since epoch by substracting DATETIME() from CURRENT, but CURRENT returns the local system time in the current timezone (not in UTC). With Genero, you typically handle date+time data with DATETIME and INTERVAL types, and you can get the current system time with the CURRENT keyword.ĭATETIME values represent a given point in time, while INTERVAL values represent a duration. What i need is something like the command "System.currentTimeMillis()" from Java does. How can i get the number of milliseconds passed since the UNIX epoch (JanuUTC) in BDL? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |