Discussion:
Bug in ShortDate
Daniel DRIJARD
2017-04-30 10:10:33 UTC
Permalink
Hello,

The following shows a problem with ShortDate.

The code:
dim laDate as new date
print "Les dates: "
print " abbreviated: "+str(laDate.abbreviatedDate)
print " shortDate : "+str(laDate.shortDate)
print " longDate : "+str(laDate.longDate)
print " shortTime : "+str(laDate.shortTime)
print " longTime : "+str(laDate.longTime)

Le résultat:
Les dates:
abbreviated: 30 04 2017
shortDate : 30/04/2015
longDate : Sunday 30 April 2017
shortTime : 11:27
longTime : 11:27:00

The date was correctly 30/04/2017. The year given by ShortDate is WRONG.
I use the last version of XOJO, 2017 release 1.1, on an iMac with OS X 10.10.5.

Cordially,
Daniel
_______________________________________________

Xojo forum:

https
Lars Jensen
2017-05-03 18:17:14 UTC
Permalink
Interesting. I just tried it with 2015r3.1, and I do not see the wrong
year. Here are my results:

Les dates:
abbreviated: May 3, 2017
shortDate : 5/3/17
longDate : Wednesday, May 3, 2017
shortTime : 11:15 AM
longTime : 11:15:19 AM
_______________________________________________

Xojo forum:

https://forum.xojo.com/
Claudius Sailer
2017-05-03 18:47:45 UTC
Permalink
I can’t reproduce your problem too.


dim laDate as new date
me.text = "Les dates: "
me.text = me.text + EndOfLine + " abbreviated: "+str(laDate.abbreviatedDate)
me.text = me.text + EndOfLine + " shortDate : "+str(laDate.shortDate)
me.text = me.text + EndOfLine + " longDate : "+str(laDate.longDate)
me.text = me.text + EndOfLine + " shortTime : "+str(laDate.shortTime)
me.text = me.text + EndOfLine + " longTime : "+str(laDate.longTime)

me.text = me.text + EndOfLine + EndOfLine + RBVersionString


Les dates:
abbreviated: 03.05.2017
shortDate : 03.05.17
longDate : Mittwoch, 3. Mai 2017
shortTime : 20:31
longTime : 20:31:49

2017r1
Post by Lars Jensen
Interesting. I just tried it with 2015r3.1, and I do not see the wrong
abbreviated: May 3, 2017
shortDate : 5/3/17
longDate : Wednesday, May 3, 2017
shortTime : 11:15 AM
longTime : 11:15:19 AM
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:
donJ
2017-05-03 18:50:41 UTC
Permalink
Post by Daniel DRIJARD
Hello,
The following shows a problem with ShortDate.
dim laDate as new date
print "Les dates: "
print " abbreviated: "+str(laDate.abbreviatedDate)
print " shortDate : "+str(laDate.shortDate)
print " longDate : "+str(laDate.longDate)
print " shortTime : "+str(laDate.shortTime)
print " longTime : "+str(laDate.longTime)
abbreviated: 30 04 2017
shortDate : 30/04/2015
longDate : Sunday 30 April 2017
shortTime : 11:27
longTime : 11:27:00
The date was correctly 30/04/2017. The year given by ShortDate is WRONG.
I use the last version of XOJO, 2017 release 1.1, on an iMac with OS X 10.10.5.
Cordially,
Daniel
For what it's worth, ShortDate returns the correct value with 2017r1.1
on Linux.
Don
_______________________________________________

Xojo forum
Jim Wagner
2017-05-03 18:58:55 UTC
Permalink
Given the failure of others to reproduce this error, maybe it involves “localization”.

Jim

James Wagner
Oregon Research Electronics
http://www.orelectronics.net <http://www.orelectronics.net/>
Post by Daniel DRIJARD
Hello,
The following shows a problem with ShortDate.
dim laDate as new date
print "Les dates: "
print " abbreviated: "+str(laDate.abbreviatedDate)
print " shortDate : "+str(laDate.shortDate)
print " longDate : "+str(laDate.longDate)
print " shortTime : "+str(laDate.shortTime)
print " longTime : "+str(laDate.longTime)
abbreviated: 30 04 2017
shortDate : 30/04/2015
longDate : Sunday 30 April 2017
shortTime : 11:27
longTime : 11:27:00
The date was correctly 30/04/2017. The year given by ShortDate is WRONG.
I use the last version of XOJO, 2017 release 1.1, on an iMac with OS X 10.10.5.
Cordially,
Daniel
_______________________________________________
https://forum.xojo.com/
_______________________________________

Loading...