# converting old format date in new format date

**URL:** <https://forum.xojo.com/t/converting-old-format-date-in-new-format-date/28485>\
**Category:** General\
**Created:** [December 5, 2015, 4:02am UTC](https://forum.xojo.com/t/converting-old-format-date-in-new-format-date/28485 "2015-12-05T04:02:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlo\_Rubini](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/94ad74/32.png) [@Carlo\_Rubini](https://forum.xojo.com/u/Carlo_Rubini)\
**Post date:** [December 5, 2015, 4:02am UTC](https://forum.xojo.com/t/converting-old-format-date-in-new-format-date/28485/1 "2015-12-05T04:02:35Z")

</div>

Hello,  
(Mac Yosemite, Xojo 2015r3.1)  
following the docs, I convert an old-format date into a new format date:

```
      dim d as new date
      d = mFile.creationDate//get the creation date of a file
      using xojo.core
      Dim dateValue As Text = d.SQLDateTime.ToText
      Dim dd As Date = Date.FromText(dateValue)//yellow triangle
      dim d1 as new Date(dd.SecondsFrom1970, new TimeZone(0))//yellow triangle

```

Running Analyze Project, I get the word “Date” in dd and d1 highlighted, along with this warning:  
“Before 2014r3, this would have referred to the Date class, but now etc.”

What should I do in order to avoid such warning?  
Thanks.

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [December 5, 2015, 4:46am UTC](https://forum.xojo.com/t/converting-old-format-date-in-new-format-date/28485/2 "2015-12-05T04:46:41Z")

</div>

You can turn off any warning you don’t care to see under the Project menu -\> Analysis Warnings.

---

<div class="post-metadata">

**Author:** ![Carlo\_Rubini](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/94ad74/32.png) [@Carlo\_Rubini](https://forum.xojo.com/u/Carlo_Rubini)\
**Post date:** [December 5, 2015, 5:41am UTC](https://forum.xojo.com/t/converting-old-format-date-in-new-format-date/28485/3 "2015-12-05T05:41:35Z")

</div>

Let me refrase it: what should I modify in the above code in order not to raise the warning.

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [December 5, 2015, 2:59pm UTC](https://forum.xojo.com/t/converting-old-format-date-in-new-format-date/28485/4 "2015-12-05T14:59:41Z")

</div>

The only thing you could do in the code is to stop using the new framework Date.

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [December 5, 2015, 4:15pm UTC](https://forum.xojo.com/t/converting-old-format-date-in-new-format-date/28485/5 "2015-12-05T16:15:58Z")

</div>

Fully qualify the names  
In mixed code I’d do that anyway as its easy to miss the “using clause” half way through the code that switches what “Date” means

dim d as new date  
d = mFile.creationDate//get the creation date of a file  
Dim dateValue As Text = d.SQLDateTime.ToText  
Dim dd As xojo.core.Date = xojo.core.Date.FromText(dateValue)  
dim d1 as new xojo.core.Date(dd.SecondsFrom1970, new xojo.core.TimeZone(0))

---

<div class="post-metadata">

**Author:** ![Carlo\_Rubini](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/94ad74/32.png) [@Carlo\_Rubini](https://forum.xojo.com/u/Carlo_Rubini)\
**Post date:** [December 6, 2015, 12:25am UTC](https://forum.xojo.com/t/converting-old-format-date-in-new-format-date/28485/6 "2015-12-06T00:25:58Z")

</div>

@Norman: Fine. Thank you.

---

<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, 6:05pm UTC](https://forum.xojo.com/t/converting-old-format-date-in-new-format-date/28485/7 "2020-10-29T18:05:35Z")

</div>


