Author Topic: Question about time command  (Read 2481 times)

0 Members and 1 Guest are viewing this topic.

Offline billy90210

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Question about time command
« on: August 28, 2019, 04:09:11 PM »
Why does the time command show my server time as 4 hours ahead of what it is?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Question about time command
« Reply #1 on: August 28, 2019, 07:08:36 PM »
Is the server timezone set correctly?
"thetime" uses straight lua os.date, which in most cases, returns the number of seconds since an epoch.
We use some formatting to turn that number into a human readable time.

Using USA for example.
Say it's 12pm GMT
If server is on west coast. (GMT-8), and your server's region is set to east coast (GMT-5), even though you MIGHT have your clock on server set to 4AM, os.date would still report epoch for 7am because that's where the region is.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline billy90210

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Question about time command
« Reply #2 on: September 05, 2019, 08:14:35 PM »
Hmm interesting, my servers location  is in New York City. It's currently 11:13pm there but !thetime is showing 3:13 AM. Not completely sure how I would change the time zone to fix this

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Question about time command
« Reply #3 on: September 06, 2019, 01:57:28 PM »
If it's shared hosting, it very well could just have the time set incorrectly too.
Either way, you'd likely have to ask your host provider.
(also, are you 'sure' it's location is NY?)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming