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.
k2backhoe Regular Member Joined: 04/12/2021 Location: United StatesPosts: 47
Posted: 04:06am 26 Jan 2022
Copy link to clipboard
Print this post
This works as per the User Manual > ? datetime$(now) 25-01-2022 10:53:50
But if I try a number instead of now, I get > ?datetime$(0) Error : 0 is invalid (valid is -2147483648 to 2147483647)
when I should get (as I read the manual) 01-01-1970 00:00:00
All other numbers do the same. Am I misreading the manual? I tried to do a search on datetime$ but couldn't find a forum entry.
Thanks, k2
panky Guru Joined: 02/10/2012 Location: AustraliaPosts: 1114
Posted: 04:35am 26 Jan 2022
Copy link to clipboard
Print this post
@k2backhoe
Peter may elaborate but I suspect that now is an internal function to return the current date and time in a format that epoch and datetime$ can use. Ie. it is not a variable available to users.
I think if you wish to set the date and time to specific values, you will have to use the date$ and time$ commands eg. date$ = "01-01-1970" print date$(now) gives 01-01-1970 0
I have no idea where the trailing 0 comes from - I suspect it is a bug?
Doug.
Edit: On reflection, the trailing 0 I believe is the other part of the 'now' internal component. I used the example of just date$ above so the time component of 'now' was not needed by date$ hence the '0'.
The short answer to this is 'don't use now in date$ or time$, just datetime$ or epoch'. D. Edited 2022-01-26 14:40 by panky... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2613
Posted: 05:21am 26 Jan 2022
Copy link to clipboard
Print this post
k2backhoe has identified an omission in datetime$. The error message suggests (as per the manual) that it is trying to process an epoch number but failing.
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10247
Posted: 07:58am 26 Jan 2022
Copy link to clipboard
Print this post
I found/fixed the bug when testing the windows version will retrofit to the PicoMite in next release
k2backhoe Regular Member Joined: 04/12/2021 Location: United StatesPosts: 47
Posted: 03:14pm 26 Jan 2022
Copy link to clipboard
Print this post
matherp and phill99, thanks so much for the prompt and comprehensive replies. I can work around this without a problem until the next release. PS. I love picomite basic, it is an excellent language that does exactly what I need to do. Thanks for it.