OT - convert notations

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

OT - convert notations

Post by SkyFrontier »

Hi, people.

Format 30304324-922355200 corresponds to date 2013-06-13 13:46

Format 30304315327317760corresponds to date 2013-06-13 13:36

Anyone has a clue on how I can convert any given date into such a format?

Thanks.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: OT - convert notations

Post by Marco »

Can you tell us what software outputs such numbers?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: OT - convert notations

Post by SkyFrontier »

Sure - Offline CD Browser.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: OT - convert notations

Post by Marco »

Seems like some form of custom unit, and time is measured from a particular moment as offset, a-la NTFS.
9595037440 should be equal to 600 seconds / 10 minutes...
I recall having seen something similar in Winamp as total played time, however it is hex and far more incomprehensible. Didn't dig further...
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: OT - convert notations

Post by SkyFrontier »

There must be a hidden trick here as the second component of the first date is negative (so yes, there's definitely an offset point here!), despite it being 10 minutes later than the second date.
Any other hint is welcome, of course.

And Marco - thanks!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: OT - convert notations

Post by SkyFrontier »

A bit more digging revealed

27846585119715840", "1980-01-01 03:00"; // oldest date allowed by XY for timestamping*
292789892085056256", "1999-06-30 15:30";
29368158-148728064", "2000-09-15 21:50"; // why this has a "-"?
30051159-1406863360", "2010-01-02 03:00"; //...just like this?
30191372658629888", "2011-11-30 03:00";
30308179913686016", "2013-07-02 18:37";

The previous data from first post is incorrect as now I see that "created" and "last used" columns are written inversely on .cdb file. So yes, it seems to be an increasing factor here but how to write it correctly? And more hideous... what's the mechanism behind the "-" appearance?

_________________
*it can be done with
::timestamp m, "1979-12-31 23:59:58";
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

admin
Site Admin
Posts: 66366
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: OT - convert notations

Post by admin »


SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: OT - convert notations

Post by SkyFrontier »

Many thanks for the tip, Don!
Current developments concerning time precision left me wondering but I see no way to convert lpFileTime (dwLowDateTime, dwHighDateTime) into lpSystemTime and vice versa, using XY scripting. Is there a way? Can it be provided, in case of a negative?
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

admin
Site Admin
Posts: 66366
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: OT - convert notations

Post by admin »

No. I would end up writing a wrapper around the whole Windows API, I'm not that crazy.

And, now that you know "Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC)." what stops you from doing the math yourself. XY scripting has all the math functions you need. :P

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: OT - convert notations

Post by SkyFrontier »

admin wrote: ...what stops you from doing the math yourself. XY scripting has all the math functions you need. :P
being "1980-01-01 00:00" (03:00 was an inaccuracy from the software which insists shifting 00h > 03h, can't tell why!) the oldest date allowed by XY for timestamping, I couldn't experiment on actual files the calc script I'd write. Not impossible, but certainly not as easy as if I'd be allowed to

::timestamp m, "1600-12-31 23:59:58";*

...can you give me a hand here...?

_________________
*provided the 1980's date it's NOT a fat32 limitation, of course.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: OT - convert notations

Post by Marco »

being "1980-01-01 00:00" (03:00 was an inaccuracy from the software which insists shifting 00h > 03h, can't tell why!) the oldest date allowed by XY for timestamping
Why you say so, are you working on FAT? Because on NTFS I can correctly timestamp a file back to 1601 (and this music comes to my mind...)
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: OT - convert notations

Post by SkyFrontier »

Yes, it's impossible for me to do the guessing on dwLow/HighDateTime without day zero to start studies.
Marco, can you give a take on this, please? Yes, I'm stuck on a FAT 32 file system and can't reach NTFS for the next days.
Bear in mind: lpFileTime into lpSystemTime and vice versa.

...and your song reminds me this one: http://www.youtube.com/watch?v=g_M_LAMaf0w, which I refuse to listen to these days.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: OT - convert notations

Post by Marco »

Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: OT - convert notations

Post by SkyFrontier »

Hm.
Errrrr...
Han...

I still can't see a way to convert those calculations into XY scripting, specially as (per my own initial observations and attempts) the farthest we could go is (like http://www.wolframalpha.com/input/?i=13 ... 0+*+100+ns clearly says) is a full amalgam of nanoseconds instead of a nice "2013-07-02 18:37" user readable format (not to mention the total lack of a clue on how to convert such date back into nanosecs!).

-and don't you dare to tell me that such conversion is 'pretty straightforward', right?
:mrgreen:

Strangely, that tune also reminds me Danny Boyle's Sunshine OST, a movie that was certainly made to be a full sensory experience.

Thanks for helping! Have a good nite.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

admin
Site Admin
Posts: 66366
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: OT - convert notations

Post by admin »

It softened my heart, next version you can do this:

Code: Select all

formatdate([date], [format], [shift_unit], [shift_num], [flags])
    flags:  1 = Date is FileTime ("high,low").
            2 = Localize (UTC to local time).

Code: Select all

echo formatdate("30304324,-922355200",,,,3);
(not officially documented)

Post Reply