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 : Bug in EPOCH()?
Author | Message | ||||
William Leue Guru Joined: 03/07/2020 Location: United StatesPosts: 393 |
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: 4044 |
Which 'mite ? I don't think 5.07.00 is the latest release version on any of them. Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
William Leue Guru Joined: 03/07/2020 Location: United StatesPosts: 393 |
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: 4044 |
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 Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
William Leue Guru Joined: 03/07/2020 Location: United StatesPosts: 393 |
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: 9130 |
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: 2077 |
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: 393 |
Thanks, Peter! I had just finished my code where I turn around the date fields and yes, it works fine. -Bill |
||||
Print this page |