Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:42 07 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Unix Time

Author Message
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 09:45am 09 Oct 2014
Copy link to clipboard 
Print this post

Has anyone in this forum ever written an MMbasic function to convert the UNIX time to a normal TIME$, DATE$ type of thing?
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 10:38am 09 Oct 2014
Copy link to clipboard 
Print this post

Yes.
But -
Until we get 32 bit integers, the range of dates that can be used is too limited to be of use.
16777100 seconds is only 194 days.
Even 32 bits will cause problems (for a lot of Unix based devices) in a few years.

You can use my arbitrary length Integer maths but it would be rather slow.

I have been working on a library of date conversion routines including Julian day numbers. By sticking to whole days and treating the part day as a separate variable, reasonable things can be done.
While working on this, I discovered that one of the common formulas available on the net was faulty. It took a while to find and test a reliable one.

You will have to be patient for a little while longer.

Jim
VK7JH
MMedit
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 03:48pm 09 Oct 2014
Copy link to clipboard 
Print this post

Hi TJ, (btw what is tassy?) That sound good, Can't wait to see your results. I never heard of this unix time thing till just recently and now it is coming up more and more. Weird....
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 04:32pm 09 Oct 2014
Copy link to clipboard 
Print this post

  viscomjim said   Hi TJ, (btw what is tassy?)

Australia has two main islands.
The one to the north we call "the mainland"
The one to the south where all the best people live is "Tasmania"

Jim
(ducking quickly to hide from the flack about to come from the north island)
VK7JH
MMedit
 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 06:11pm 09 Oct 2014
Copy link to clipboard 
Print this post

Hey TassyJim,
You forgot the two de facto island states to the east, also known as New Zealand.

Puts on fireproof coat...


Bob Devries
Dalby, QLD, Australia
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 06:26pm 09 Oct 2014
Copy link to clipboard 
Print this post

I've been living on the bigger "North" island for 35 years now Jim but Tassy, I usually spell it Tassie is still home to me. FYI, people living in Tassie(y) are also known as "Taswegians" as well as Tasmanians. Because of its better quality of life, jealous "mainlanders" are fond of telling a very tired joke about Tasmanians having a scar where their second head was removed

Greg
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025