formatDateTime

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

JoshuaW
Ebase User
Posts: 19
Joined: Fri Oct 24, 2008 1:55 pm
Location: WFH, Oxfordshire, UK
Contact:

formatDateTime

#1

Postby JoshuaW » Thu Nov 27, 2008 12:55 pm

Hi all,

We have a table with columns showing date-time but they're showing seconds to the three decimal places, which is ugly.

ie: dd/mm/yyyy HH:MM:SS.TTT so basically I want to get rid of [SS.TTT] and what's the best way to do it?

There isn't a command for formatDateTime. I've converted it to string but it's unworkable because of the sorting in the column wouldn't work.

Is UFSSetup,properties the best place to start?

I found this line

Code: Select all

Ufs.dateFormat=dd/mm/yyyy
Will it work if I add this following line

Code: Select all

Ufs.timeFormat=HH:MM
or should it be something like this?

Code: Select all

Ufs.datetimeFormat=dd/mm/yyyy HH:MM
Thanks for reading this and hopefully you'll have a suggestion to help us.
Cheers
Josh
0 x

User avatar
Joost
Ebase User
Posts: 49
Joined: Fri Sep 14, 2007 6:14 pm
Location: The Netherlands

Re: formatDateTime

#2

Postby Joost » Mon Dec 01, 2008 6:59 am

JoshuaW wrote:We have a table with columns showing date-time but they're showing seconds to the three decimal places, which is ugly.

ie: dd/mm/yyyy HH:MM:SS.TTT so basically I want to get rid of [SS.TTT] and what's the best way to do it?
I do not think there is a way to format it, besides doing it yourself. I use two seperate fields for input. When your db contains a time column, you may use the timetostring function in combination with a substring function. Perhaps you could format in a SQL query.

Customer portal problem log #331200 points to enhancement log #400369. It may help voting for the enhancement log.
0 x

User avatar
Sarah
Ebase User
Posts: 63
Joined: Fri Sep 07, 2007 2:42 pm
Location: Sandy, UK
Contact:

#3

Postby Sarah » Fri Dec 05, 2008 10:53 am

There is an Ebase function " formatdate", which can be used to change a date to a different format.

The syntax is:

Code: Select all

  formatdate(date1,string2);
which formats the date in 'date1' to the given format in 'string2'. For example: "EEE dd MMM, YYYY"

Full information can be found in the Script Command Syntax section of the Ebase help documentation.
0 x


Who is online

Users browsing this forum: No registered users and 125 guests