Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Long date to Short
#6
If i am not mistaken date strings are locale specific . if your long date string is not in english will have to adjust find .

if the day is first and in another language change code to something like this

Code:
Copy      Help
str s.timeformat("{DD}")
out s
// remove day and comma from string
int i = find(s "," 0 1)
s.remove(0 i+1)
s.trim
out s
//convert to Date
DATE d1(s)
out d1
//convert to DateTime if needed
DateTime d.FromStr(s) ;;;directly from string
out d.ToStr(1)
DateTime d2.FromDATE(d1);;from Date
out d2.ToStr(1)

this finds the first comma and removes everything to the left of it. to help more post the output of str s.timeformat("{DD}")


Messages In This Thread
Long date to Short - by ssimop - 03-08-2018, 11:51 AM
RE: Long date to Short - by Gintaras - 03-08-2018, 12:06 PM
RE: Long date to Short - by Gintaras - 03-08-2018, 12:09 PM
RE: Long date to Short - by Kevin - 03-20-2018, 06:56 PM
RE: Long date to Short - by ssimop - 03-20-2018, 07:57 PM
RE: Long date to Short - by Kevin - 03-22-2018, 04:48 AM
RE: Long date to Short - by ssimop - 03-23-2018, 01:21 AM
RE: Long date to Short - by Kevin - 03-23-2018, 03:37 AM
RE: Long date to Short - by Kevin - 03-23-2018, 06:16 AM
RE: Long date to Short - by Kevin - 03-26-2018, 06:53 AM
RE: Long date to Short - by ssimop - 03-26-2018, 07:15 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)