# Date.Shortdate does not seem to work?!

**URL:** <https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448>\
**Category:** Windows\
**Created:** [March 12, 2018, 7:24pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448 "2018-03-12T19:24:54Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![H\_Schippers](https://forum.xojo.com/letter_avatar_proxy/v4/letter/h/eada6e/32.png) [@H\_Schippers](https://forum.xojo.com/u/H_Schippers)\
**Post date:** [March 12, 2018, 7:24pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/1 "2018-03-12T19:24:54Z")

</div>

Dear all,

I’m developing an application for mac and windows 10. I’m building it brick by brick so to say and now a simple line of code does not seem to work on windows 10. I think I’m overseeing something, but I can’t figure it out what.

I want to print the shortdate in a textarea. On mac this works, but on windows it gives me a blank space. When I use the example code for shortdate it also does not work.

Example code:  
Dim d As New Date  
MsgBox(d.shortdate)

I’ve checked the locale of my windows 10 machine and the short date is there how I want it to see in a textarea or a msgbox.

Can someone help me?

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [March 12, 2018, 7:31pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/2 "2018-03-12T19:31:53Z")

</div>

have you checked the Win10 System Preferences for how dates should be formatted?  
Perhaps on this particular machine the format is invalid (or blank)??? just an idea

---

<div class="post-metadata">

**Author:** ![H\_Schippers](https://forum.xojo.com/letter_avatar_proxy/v4/letter/h/eada6e/32.png) [@H\_Schippers](https://forum.xojo.com/u/H_Schippers)\
**Post date:** [March 12, 2018, 7:38pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/3 "2018-03-12T19:38:59Z")

</div>

I’ve checked the preferences. see link to pictures.  
[picture 1](https://www.dropbox.com/s/wpcfte8jh0a9vxo/Screen%20Shot%202018-03-12%20at%2020.33.34.png?dl=0)  
[picture 2](https://www.dropbox.com/s/5tiidybz37unrcq/Screen%20Shot%202018-03-12%20at%2020.33.53.png?dl=0)

I’m having this issue on two windows 10 machines.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [March 12, 2018, 8:10pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/4 "2018-03-12T20:10:25Z")

</div>

If you can reproduce it reliably file a bug report.

To solve the immediate issue, I would roll my own method. It is not that difficult to do.

---

<div class="post-metadata">

**Author:** ![H\_Schippers](https://forum.xojo.com/letter_avatar_proxy/v4/letter/h/eada6e/32.png) [@H\_Schippers](https://forum.xojo.com/u/H_Schippers)\
**Post date:** [March 12, 2018, 8:23pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/5 "2018-03-12T20:23:11Z")

</div>

I will try to change locales and see what will happen. If it will not change I will file a bug report.

---

<div class="post-metadata">

**Author:** ![Markus\_Winter](https://forum.xojo.com/user_avatar/forum.xojo.com/markus_winter/32/144_2.png) [@Markus\_Winter](https://forum.xojo.com/u/Markus_Winter)\
**Post date:** [March 12, 2018, 8:40pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/6 "2018-03-12T20:40:18Z")

</div>

What happens with LongDate?  
What happens if you actually set the date?

---

<div class="post-metadata">

**Author:** ![H\_Schippers](https://forum.xojo.com/letter_avatar_proxy/v4/letter/h/eada6e/32.png) [@H\_Schippers](https://forum.xojo.com/u/H_Schippers)\
**Post date:** [March 12, 2018, 9:08pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/7 "2018-03-12T21:08:49Z")

</div>

Longdate also does not work. I figured that out 2 minutes ago. There has to be some setting I miss in win10.

If I set the date it will show the date with 00:00:00 time in a msgbox, but when I use ShortDate or Longdate both MsgBoxes are empty.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [March 12, 2018, 9:39pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/8 "2018-03-12T21:39:39Z")

</div>

Have you tried both Date and Xojo.Core.Date ? The latter should not exhibit the same bug.  
[http://developer.xojo.com/xojo-core-date](http://developer.xojo.com/xojo-core-date)

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [March 12, 2018, 9:56pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/9 "2018-03-12T21:56:21Z")

</div>

What version of Xojo are you using?

---

<div class="post-metadata">

**Author:** ![H\_Schippers](https://forum.xojo.com/letter_avatar_proxy/v4/letter/h/eada6e/32.png) [@H\_Schippers](https://forum.xojo.com/u/H_Schippers)\
**Post date:** [March 13, 2018, 5:10am UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/10 "2018-03-13T05:10:56Z")

</div>

@  
I’m using the latest version of Xojo.

@Michel Bujardet  
I will try it with Xojo.Core.Date tonight or tomorrow.

---

<div class="post-metadata">

**Author:** ![Markus\_Winter](https://forum.xojo.com/user_avatar/forum.xojo.com/markus_winter/32/144_2.png) [@Markus\_Winter](https://forum.xojo.com/u/Markus_Winter)\
**Post date:** [March 13, 2018, 6:46am UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/11 "2018-03-13T06:46:56Z")

</div>

And my usual trouble-shooting favorite: have you restartet the computer?

Sometimes Xojo gets into a state where it behaves weirdly. Restarts usually fix that.

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [March 13, 2018, 10:11am UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/12 "2018-03-13T10:11:59Z")

</div>

It looks like a bug, as soon as I set my date region to the same as yours (English (Netherlands)) it comes back with a blank format.

---

<div class="post-metadata">

**Author:** ![Markus\_Winter](https://forum.xojo.com/user_avatar/forum.xojo.com/markus_winter/32/144_2.png) [@Markus\_Winter](https://forum.xojo.com/u/Markus_Winter)\
**Post date:** [March 13, 2018, 12:02pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/13 "2018-03-13T12:02:37Z")

</div>

> [@377480:@](#):
>
> It looks like a bug, as soon as I set my date region to the same as yours (English (Netherlands)) it comes back with a blank format.

Nicely spotted!

---

<div class="post-metadata">

**Author:** ![AlbertoD](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@AlbertoD](https://forum.xojo.com/u/AlbertoD)\
**Post date:** [March 13, 2018, 1:18pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/14 "2018-03-13T13:18:41Z")

</div>

> [@377480:@](#):
>
> It looks like a bug, as soon as I set my date region to the same as yours (English (Netherlands)) it comes back with a blank format.

I think I read a bug report about that some time ago, but I was not able to find it on Feedback. At that time I think it was verified.

---

<div class="post-metadata">

**Author:** ![H\_Schippers](https://forum.xojo.com/letter_avatar_proxy/v4/letter/h/eada6e/32.png) [@H\_Schippers](https://forum.xojo.com/u/H_Schippers)\
**Post date:** [March 13, 2018, 1:52pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/15 "2018-03-13T13:52:18Z")

</div>

@  
Thanks for verifying. Both of my Win10 machines have the same region so that would explain a lot.

I will file a bug report tonight.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 7:07pm UTC](https://forum.xojo.com/t/date-shortdate-does-not-seem-to-work/42448/16 "2020-10-29T19:07:52Z")

</div>


