Page 1 of 1

date format

Posted: Mon Mar 03, 2014 12:34 pm
by link76
Hello,

I would like to convert this date: 7-2-2014 >> 7-Feb-2014:

Code: Select all

put "7-2-2014" into tDate
set itemdelimeter "-"
put datefunction (%B, item 2 of tDate........ 
thank you

Re: date format

Posted: Mon Mar 03, 2014 12:52 pm
by Klaus
Hi link76,

there is no build-in function to deal with this date format, so you need to make your own.

Quick shot:
...
put "7-2-2014" into tDate
set itemdelimeter "-"

## Since it looks like you only need the abbreviated month name, you can do something like this:
## 1. get the month NUMBER from the date:
put item 2 of tDate into tMonth

## 2. Now use the bulid-in "monthnames" function:
put the line tMonth of the abbr monthnames into item 2 of tDate
## tDate = 7-Feb-2014 :D
## Done!
...

Best

Klaus