cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

DateTimeValue Conversion Issue

I am in the process of converting my application to sharepoint and i'm running into a weird (to me) error.  I use a label that is just a now() function.  This label is called Date100.  When I patch the data to my sharepoint list, I use a patch function.  Here are the two relevant lines.  

 

Date: DateTimeValue(date100.Text,"ca-ES"),
DateValue: Value(Text(Today(),"[$-en-US]yyyymmdd")),

 

The correct value should be 11/12/2019.  However, after the first entry it is reading it as 12/11/2019.  The date value is reading it correctly 2019-11-12.  What do I need to do to convert this to 11/12/2019? Note: The time is coming over correctly.

weord.PNG

 

 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: DateTimeValue Conversion Issue

@dyee4614 

Any reason you have chosen the language "ca-ES" in your first line instead of "en-US" as is shown in your second line?  Changing the code...

 

Date: DateTimeValue(date100.Text,"ca-ES")

 

...to this instead appears to result in 11/12/2019.  I've tested on my side.

 

Date: DateTimeValue(date100.Text,"en-US")

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: DateTimeValue Conversion Issue

@dyee4614 

Any reason you have chosen the language "ca-ES" in your first line instead of "en-US" as is shown in your second line?  Changing the code...

 

Date: DateTimeValue(date100.Text,"ca-ES")

 

...to this instead appears to result in 11/12/2019.  I've tested on my side.

 

Date: DateTimeValue(date100.Text,"en-US")

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Community Support
Community Support

Re: DateTimeValue Conversion Issue

Hi @dyee4614 ,

 

What is the column type of "DateValue" column in your SharePoint list? Is it a date column or a number column? Are you trying to convert date to number? If so, please use below formula in the label control:

Value(Text(Now(),"[$-en-US]yyyymmdd"))

 

Regards,

Mona 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Resolver I
Resolver I

Re: DateTimeValue Conversion Issue

Ha.  That was it.  For some reason, I thought ca-ES was English.  This is embarrassing.

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,063)