Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 13:05 17 May 2024 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 : DATE$ bug?

     Page 1 of 2    
Author Message
Oldbitcollector

Senior Member

Joined: 16/05/2014
Location: United States
Posts: 172
Posted: 12:57pm 23 Sep 2014
Copy link to clipboard 
Print this post

Have I stumbled over a bug?

I can set DATE$ to anything up to 09-12-2014
any date beyond that, 09-13-2014 - 09-30-2014 is rejected.

The problem appears to solve itself, (at least for a while) at 10-01-2014.

Jeff

My Propeller/Micromite mini-computer project.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 01:09pm 23 Sep 2014
Copy link to clipboard 
Print this post

Think Australian Dates!

dd-mm-yyyy

Jim

VK7JH
MMedit   MMBasic Help
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 01:12pm 23 Sep 2014
Copy link to clipboard 
Print this post

Jeff
Australia uses a different date format from USA. Try dd/mm/yyyy. The manual is quite explicit about the format.

I think they are all a bit irrational. I prefer yyyy/mm/dd
debate anyone??
Bob
 
Oldbitcollector

Senior Member

Joined: 16/05/2014
Location: United States
Posts: 172
Posted: 01:21pm 23 Sep 2014
Copy link to clipboard 
Print this post

Wow.. I actually read right past that! TWICE..

Thanks for setting me straight.

Yes, we Americans do tend to do things very strangely here. Drive on the wrong side of the road, and use the most ridiculous system of measurement. I'll make sure I start using the "correct" format for date from now on.

Yes, +1 for yyyy/mm/dd..


My Propeller/Micromite mini-computer project.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9080
Posted: 01:35pm 23 Sep 2014
Copy link to clipboard 
Print this post

I prefer the current DD/MM/YYYY arrangement, but that is just cos this is what we use here, so I am comfortable with how it is.

Had I been born and lived in the United Stated, I would be just as comfortable with MM/DD/YYYY.

Everything is relative!

Would it be worth Geoff perhaps having yet ANOTHER option command for the date format?

OPTION DATE 1 for DD/MM/YYYY, and OPTION DATE 2 for DD/MM/YYYY kind of thing?

HOWEVER - it's not really needed, so long as you know the date format. With that and MID$, you can re-arrange the date anyway you like, such that you could have something along the lines of:

DATE_USA$=MID$(DATE$,4,3) + MID$(DATE$,1,3) + MID$(DATE$,7,10)

DATE_USA$ will have the American format - 09/24/2014 for today, for example.

You could do the same kind of thing in reverse, for setting the date - just ask for the month, date and year in separate variables, then combine them, and submit them to DATE$

EDIT: Fixed syntax errors - sorry. Edited by Grogster 2014-09-24
Smoke makes things work. When the smoke gets out, it stops!
 
Justplayin

Guru

Joined: 31/01/2014
Location: United States
Posts: 313
Posted: 02:01pm 23 Sep 2014
Copy link to clipboard 
Print this post

Since it seems like no matter what format the date is in it always needs to be reformatted, I think I would prefer yyyy/mm/dd. It's just easier to use for date comparisons and sorting. But in the end, it doesn't really matter, because you still end up chopping it up into your favorite format to display it anyway.

--Curtis
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 02:02pm 23 Sep 2014
Copy link to clipboard 
Print this post

Being of Pommy heritage (a few generations ago), I prefer to follow the lead set in the "Magna Carta"

  Quote  Given by our hand in the meadow that is called Runnymede, between Windsor and Staines, on the fifteenth day of June in the seventeenth year of our reign (i.e. 1215: the new regnal year began on 28 May).


I have spent most of my programming life changing the "other" format into propper English so I think it's time that we got our own back.

For timestamping I do use yyyymmdd to make sorting easier.

There are other choices
  Quote  24-09-2014 10:04:09
Julian Day : 2456925
Day of Week: 3 Wed
Day of year: 267
Unix time = 1411553049


JimEdited by TassyJim 2014-09-25
VK7JH
MMedit   MMBasic Help
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 03:13pm 23 Sep 2014
Copy link to clipboard 
Print this post

  Quote  Given by our hand in the meadow that is called Runnymede, between Windsor and Staines, on the fifteenth day of June in the seventeenth year of our reign (i.e. 1215: the new regnal year began on 28 May).
Blimey, thats where I live!!

I prefer yyyy/mm/dd (easier for sorting)Edited by WhiteWizzard 2014-09-25
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Lou

Senior Member

Joined: 01/02/2014
Location: United States
Posts: 229
Posted: 03:55pm 23 Sep 2014
Copy link to clipboard 
Print this post


Lets concentrate on the "Real Date", Stardate 2014.266 (for Sept 23, 2014).

Lou
Microcontrollers - the other white meat
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5036
Posted: 04:21pm 23 Sep 2014
Copy link to clipboard 
Print this post

Dont get me started on the USA date format

Oops, too late.

As a software developer, I think of the MM/DD/YYYY format as the biggest pain in the bum I once had to deal with. Especially when dealing with databases, and its a big trap for beginners. The problem is a database, Access for example, will assume you are using the USA format ( MM/DD/YYYY ), even though its on a device with another countries regional settings. Most of the time . If I ask a database to return records with a date of 1/1/2014, it returns records from 1st January 2014. If I ask for 2/1/2014, it returns data for the 1st February 2014!!! Fair enough, it wants a USA format. But if I ask for a date of 13/1/2014, the database thinks "this is not a USA date, lets try something else", and returns data for 13th January 2014. So it basically cant be trusted to return the right records, because it changes format until it finds one that works.

The solution is to use a long date format like "13 January 2014", which it cant mess up.

But, if I ask the database to give me the date for a record, it returns the date in the regional format, not the USA format.

So to reliably talk to a Access database, you insert/update or query records in a long date format, but the result is in a regional format.

I've also seen this problem pop up with expiry dates on chemicals and medicines. "1/10/2014" could mean it expired on the 1st October, or the 10th Jan. Big problem.

I prefer the format of YYYY/MM/DD which cant be stuffed up.

Yep, its a pet hate.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 05:59pm 23 Sep 2014
Copy link to clipboard 
Print this post

ISO 8601

specifies date in YYYY MM DD format

and like GIZMO the US vs Europe/Australia/NZ data format has caught me out so many times, I learned to just use and insist upon ISO date and time formatting.

73

Peter
The only Konstant is Change
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5036
Posted: 06:09pm 23 Sep 2014
Copy link to clipboard 
Print this post

  Grogster said   Would it be worth Geoff perhaps having yet ANOTHER option command for the date format?


Big NO from me. 2 reasons,

1. Its an Australian developed chip, so should stick with Australian conventions, and

2. I think of it as revenge for all the times I was caught out by the USA date format

Glenn


The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9080
Posted: 07:13pm 23 Sep 2014
Copy link to clipboard 
Print this post

Ha, ha, ha - fair enough, Glenn!

I was going to mention Stardate, but Lou beat me to it!

In my MaxiMite system which logs any calls on the system to a daily logfile, I just use a nice simple 7-character filename representing the date: 24SEP14.LOG for today, for example. That is nice and easy to understand, and even our American chums should be able to follow that without getting confused.
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 01:49am 24 Sep 2014
Copy link to clipboard 
Print this post

So that would be September 14 in the year 1924?
:)

My preferred way is 20140924. I found it to be the most useful for log files to be able to batch process them and sort them easily.



Microblocks. Build with logic.
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 02:04am 24 Sep 2014
Copy link to clipboard 
Print this post

  TZAdvantage said   So that would be September 14 in the year 1924?
Don't be silly, its obvious it's the 24th Sept 1914
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1421
Posted: 06:05am 24 Sep 2014
Copy link to clipboard 
Print this post

  G8JCF said   ISO 8601

specifies date in YYYY MM DD format

and like GIZMO the US vs Europe/Australia/NZ data format has caught me out so many times, I learned to just use and insist upon ISO date and time formatting.

73

Peter


Amen. I use ISO 8601 as often as I can. I've been an annoying advocate of that for years.
Micromites and Maximites! - Beginning Maximite
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2870
Posted: 11:27am 24 Sep 2014
Copy link to clipboard 
Print this post

Geoff,

Please don't change the date format..

If we Aussies have to learn that brownies are cakes and the alphabet ends x, y, zee and that cakes are covered in Frosting instead of icing then the rest of the world can learn some aussie 'standards'

Gawd, strewth, strike me hooray sport.. Fair dinkum cobbers

Regards Mick. (Obviously tongue in check)





Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 12:00pm 24 Sep 2014
Copy link to clipboard 
Print this post

Mick

If anything, the Date Time format should be ISO8601, that way it's above national and cultural (except for Japan) preferences, and is clearly the most logical, and unambiguous formats.

I do seriously know of a project which came in months late solely because of the misunderstanding about DD/MM vs MM/DD, I can't remember exactly what, but it was something like, 6/8/2002 in Europe, but 8/6/2002 in the USA on the project plans. Needless to say the Americans were NOT very happy/amused when they found out the s/w was being delivered in August rather than June, and the European developers were even less happy/amused when they were "asked" to work day and night to bring the delivery date forward.

PeterEdited by G8JCF 2014-09-25
The only Konstant is Change
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9080
Posted: 12:12pm 24 Sep 2014
Copy link to clipboard 
Print this post

@ TZA and WW - Had not thought of that!

Looks like ISO8601 has merit, and, as has been pointed out by others, can't be confused. I guess these things only become an issue for the likes of MaxiMite/MicroMite, now that they have "Left the nest", so to speak, and are much more international now then they were in the beginning.
Smoke makes things work. When the smoke gets out, it stops!
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 12:18pm 24 Sep 2014
Copy link to clipboard 
Print this post

As I indicated in the first response to this thread, I think that the ISO form of date is the only rational one available. Like Gizmo, I am crapped off trying to figure out which date format I am dealing with at any instant and many times still not being sure if the month and day components are simultaneously less than 13.

I think I'll start the "All Dates should be ISO" campaign.
 
     Page 1 of 2    
Print this page
© JAQ Software 2024