Howdy,
So I just did a new compile, and updated my test environment and alterant. They are built from commit 4bb08eded
I posted a message on my test environment, which is configured for PST (UTC-08:00):
when_written 6764CF1E FE20 Fri Dec 20 12:57:50 2024 UTC-8:00
And on alterant, it's showing you new time hex, but the date string is off by one day:
when_written 03271E72 FE20 Thu Dec 19 17:57:50 2024 UTC-8:00 when_imported 6768D894 9258 Mon Dec 23 14:27:16 2024 AEDT
Looks like I had my test enviornment configured wrong date confirmed PST, but scfg -> System -> Local Time Zone I must have selected EST. I noticed this, because alterant was reporting:
Thu Dec 19 2024 05:57 pm UTC-8:00 (3.1 days ago)
and my test environment is reporting:
Fri Dec 20 2024 12:57 pm UTC-8:00 (2.3 days ago)
Weird that you've got 3 different time zones (PST, EST, and AEDT) going on between 2 systems.
I'm not sure how you posted that message, but the hex value there (for when_written.time) is a time_t not the bit-field-endoded date that's used in commit 4bb08eded. So something's amiss.
stat -c '%X' text/extra/100219b1734659870
I'm not sure how you posted that message, but the hex value there (for when_written.time) is a time_t not the bit-field-endoded date that's used in commit 4bb08eded. So something's amiss.
Yup, it is very weird - but a scenario that a sysop could be in, if the have to set the SBBS time seperately to the OS time.
Re: Commit f9ad15e8 might need more work :)
By: deon to Digital Man on Mon Dec 23 2024 05:11 pm
Howdy,
I'm not sure how you posted that message, but the hex value there (for when_written.time) is a time_t not the bit-field-endoded date that's used in commit 4bb08eded. So something's amiss.
Oh boy... So I just had another look at this:
My test system (which is PST for OS and Sync):
But to be sure, I just posted another message:
X-FTN-PID Synchronet 3.20a-Linux master/4bb08eded Dec 23 2024 GCC 10.2.1 when_written 6764CF1E FE20 Fri Dec 20 12:57:50 2024 UTC-8:00 when_imported 6769155F 41E0 Mon Dec 23 18:46:39 2024 PST
A few things here:
a) when_written
The file that the date is based off of:
root@ansitex-dev# stat -c '%x' text/extra/100219b
2024-12-19 17:57:50.286025007 -0800
To confirm:
root@ansitex-dev# jsexec -n tools/test-strftime
File Date: 1734659870
Thu, 19 Dec 2024 17:57:50 -0800
And the contents of test-strftime.js
var f = new File('text/extra/100219b');
var fdate = f.date;
writeln('File Date: '+fdate);
writeln(strftime("%a, %d %b %Y %H:%M:%S %z",fdate));
So how is it getting when_written_time Fri Dec 20 12:57:50 2024?
b) when_imported_time
I dont set this value, so it is automatically calculated right?
root@ansitex-dev# date
Sun Dec 22 23:48:39 PST 2024
root@ansitex-dev# ls -al /etc/localtime
lrwxrwxrwx 1 root root 39 Dec 22 18:06 /etc/localtime -> /usr/share/zoneinfo/America/Los_Angeles
Startup:
synchronet: term Compiled master/4bb08eded Dec 23 2024 10:39 with GCC 10.2.1 synchronet: web Synchronet Web Server Version 3.20a
synchronet: web Compiled master/4bb08eded Dec 23 2024 10:39 with GCC 10.2.1 synchronet: term Initializing on Sun Dec 22 23:34:25 2024 with options: 2c02 synchronet: web Initializing on Sun Dec 22 23:34:25 2024 with options: 810
Where is it getting Mon Dec 23 18:46:39 from ? (Which coincidently, the AU local time right now.)
I posted that message with save_msg(), but I used
hdr.date = strftime("%a, %d %b %Y %H:%M:%S %z",this.__properties__.date)
hdr.date = strftime("%a, %d %b %Y %H:%M:%S %z",this.__properties__.date)
The 'date' property is specifically for importing from RFC822-formatted messages. You probably shouldn't be using that.
How are you posting that message? When I post messages using the terminal server or using smbutil to import a message, I'm seeing the bit-encoded date values in hex (with the '0' initial nibble).
I'm confused about your time zone settings and systems, so I'm not really following.
Re: Commit f9ad15e8 might need more work :)
By: Digital Man to deon on Mon Dec 23 2024 01:05 am
hdr.date = strftime("%a, %d %b %Y %H:%M:%S %z",this.__properties__.date)
The 'date' property is specifically for importing from RFC822-formatted messages. You probably shouldn't be using that.
Isnt strftime("%a, %d %b %Y %H:%M:%S %z") resulting in an RFC822 format?
https://validator.w3.org/feed/docs/error/InvalidRFC2822Date.html
and https://www.w3.org/Protocols/rfc822/#z28
Although the later link says a 2 digit year.
What about this format is incorrect (it appeared to result in the correct when_written_time before I updated).
So, I killed everything, and started just the PST container, posted messages and they are infact the correct time string - for both the when*time values. When using save_msg() with hdr.date, it doesnt use your new when_written_time encoding though.
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 4 |
Nodes: | 8 (0 / 8) |
Uptime: | 58:51:17 |
Calls: | 65 |
Files: | 21,500 |
Messages: | 73,554 |