How to convert String to Date?

Understanding basics of 1C:Enterprise platform. To start working with 1C:Enterprise platform visit Getting started page

#1
People who like this:0Yes/0No
Active user
Rating: 5
Joined: Sep 27, 2011
Company:

Hello!
I have the following problem:
When I hardcode a date it is formatted as I need:

Code
Format('20120521104259', "DF='MM/dd/yyyy hh:mm:ss tt'")

produces 05/21/2012 10:42:59 AM
But I need to format a date which I calculate programmatically as a number:
Code
Value = 20120521104259; // it supposed to be a string
Format(Value, "DF='MM/dd/yyyy hh:mm:ss tt'")

produces 20 120 521 104 259
How can I convert a string into date?

 
#2
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Apr 17, 2012
Company: Zoi TechCon GmbH

Code
Format(Date(Format(Value,"NG=")), "DF='MM/dd/yyyy hh:mm:ss tt'")

 
#3
People who like this:0Yes/0No
Active user
Rating: 5
Joined: Sep 27, 2011
Company:

Good! Thank you!

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.