Author Topic: Time Stamps  (Read 3294 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Time Stamps
« on: August 22, 2019, 11:44:14 am »
It is funny how I sort of got sucked into this topic of time stamps.

In past I have always used the date$ function to time stamp my files unless I needed something down to the hour minute or second, I was doing date$ and time$ stamps with conversations with ELIZA or the Player code that came after ELIZA generalizing on lessons ELIZA code taught, maybe an _ between date and time, maybe just a space, ha! maybe I should use signature + Date$ + "+" + Time$ hmm...

Then Steve comes along and teaches us about Unix Epoch time stamps, a universal standard, cool!

But with the Y2K fiasco, I get to thinking "universal standard" that restricts start to 1970? hmm...

I suppose the Unix Epoch standard does shave the number down to single 64 bitter (or is it 4 bytes? 8 bytes my guess), my point is only a freak'n computer can read the thing!

I say, for a truly Universal TimeStamp, that maybe a human should be able to read it and understand it nearly as quick as a computer, at least be able to tell on sight whether one date is earlier or later than another and grossly approximate how much in human terms of years, months, days, hours, minutes, seconds.

To be globally correct we might have to include Time Zone and DST for comparing times and dates with other folks around the world.

This in my opinion is what the spirit of Basic is about bringing the power of lofty abstract reasoning down to the level of general human understanding and practical use.

I dunno, do you want a timestamp only a computer and the right program can read, or do you want one anyone can read and understand?

BTW I want one I can sort, so I start with year the most important gross detail (except maybe Time zone) and end with finest detail of second.



Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Time Stamps
« Reply #1 on: August 22, 2019, 11:56:57 am »
Quote
But with the Y2K fiasco, I get to thinking "universal standard" that restricts start to 1970? hmm...

There’s negative timestamps, and my latest function should produce them accurately for us.  ;)



The easiest system I’ve found for readability and ease of human sorting (and what I use for $AUTOSAVE timestamps) is:
YYYY-MM-DD-HH-mm-SS.sss

Year,month,day,24-hour format hour, minute, second.miliseconds.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Time Stamps
« Reply #2 on: August 22, 2019, 01:41:45 pm »
Hi Steve, is the .sss also a file extension?

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Time Stamps
« Reply #3 on: August 22, 2019, 02:36:43 pm »
Hi Steve, is the .sss also a file extension?

Just a representation of seconds(SS).miliseconds(sss).  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: Time Stamps
« Reply #4 on: August 24, 2019, 03:15:13 am »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Time Stamps
« Reply #5 on: August 24, 2019, 10:12:27 am »
Meet my friend ISO 8601: https://en.m.wikipedia.org/wiki/ISO_8601

I am glad your friend agrees with me, e seems a bit more elaborate than I :D

For files, the : separator for time won't work and the dot separator for splitting secs is confusing with file extensions, might be OK, just confusing. For me, file name labeling is The Time for Time Stamps.