Code: Select all
PROBLEM WITH THE DATE FORMAT USED BY HOLLYWOOD AND THE AMIGA SYSTEMS
;Format dates:
;"jueves 10-nov-22 12:51:49" ;Format got from a file save with: Execute("Date >ENVARC:MiHora")
;"11-Nov-2022 12:51:49" ;Format from computer clock and Hollywood.
;We make the MiHora file:
Execute("Date >ENVARC:MiHora")
;Get computer date and hour:
FechaSystem$=GetDate(#DATELOCAL)
;Get the date from the file created with Execute on MorphOS or AmigaOS3.9
OpenFile(1, "ENVARC:MiHora", #MODE_READ)
While Not Eof(1) Do FechaFile$=ReadString(1)
CloseFile(1)
;Here is the problem with the different format, even when you with the
;instruction RightStr(FechaFile$, 19) you remove the day "jueves" from
;from the string but the problem is the month "nov" for example in lower
;letter because Hollywood uses "Nov".
ResultaCompara=CompareDates(FechaFile$, FechaSystem$)
;The CompareDates only compare full dates in the format dd-mmm-yyyy hh:mm:ss
;but with the month in capital letter.