(Date) string to local time conversion
Posted: 2 Dec 2014 11:30
Hi,
I'm trying to convert a string formatted as a short date, dd/m/yyyy, to a local time value using code that looks like this:-
The resulting local time variable is that of the current time, contrary to expectation. What am I not doing right?
Many thanks.
I'm trying to convert a string formatted as a short date, dd/m/yyyy, to a local time value using code that looks like this:-
Code: Select all
/*
Converts the given string to a local time value*/
str_2_localtimevalue(Str)=LocalTimeValue:-
/*
Create a new time object*/
Time = time::new(),
/*
Set the date/time according to given string (short date) format, dd/mm/yyyy.
(THIS SETTING IS NOT BEING EFFECTED. THE CURRENT TIME SET DURING CREATION OF THE TIME
OBJECT DOES NOT CHANGE. WHY?*/
Time:setFromString(Str),
/*
Retrieve and return the local time value*/
Time:getTime()=LocalTimeValue.
Many thanks.