![]() |
Forum Index : Microcontroller and PC projects : Bug in EPOCH()?
Author | Message | ||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
I wonder if this is a bug in the EPOCH() function in MMBASIC VER 5.07.00, or just my usual stupidity? This little program gives me a syntax error when it hits the epoch() function: option default integer fname$ = "Solver.bas" mdt$ = MM.INFO$(MODIFIED fname$) print mdt$ secs = epoch(mdt$) print secs end The date/time string printed out on line 4 looks fine: "08-05-2023 13:58:04" But I get "Error on line 5: Invalid date" Any clues? -Bill |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Which 'mite ? I don't think 5.07.00 is the latest release version on any of them. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
Color Maximite 2 Gen 2. I haven't seen any more recent releases for the CMM2 except for betas, but I may have missed one. -Bill |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
The latest release version on Geoff's website is 5.07.01. I'm pretty sure that I've found and Peter has fixed at least one bug in the CMM2 EPOCH() implementation, but that may have been for one of the 5.07.02 betas. Best wishes, Tom Edited 2023-05-09 04:17 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
Thanks, Tom! For now, I will just write my own version of epoch(), not too hard. -Bill |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
The time string from modified is the wrong way round - should be "YYYY-MM-DD HH:MM:SS". This is certainly corrected in the current beta but I'm not sure when the correction was made. in fact the latest betas allows both time formats for epoch Edited 2023-05-09 04:39 by matherp |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
http://www.fruitoftheshed.com/MMBasic.UnixTime-or-Epoch-Time.ashx may help. written for the Micromite, works well but I think you'd be better tweaking it to fit the PicoMite because there are functions in the later basics that are not present for the micromite e.g. Field() This function works tightly with my Split() function (which is comparable with Field) referenced in the wiki. This UnxTime() function gets battered in loads of my code Edited 2023-05-09 05:31 by CaptainBoing |
||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
Thanks, Peter! I had just finished my code where I turn around the date fields and yes, it works fine. -Bill |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |