INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: FormatDate improvements  (Read 1073 times)

leoric

  • World Citizen
  • ***
  • Posts: 164
FormatDate improvements
« on: June 20, 2010, 04:25:36 am »

I want my photos to have naming scheme "yy-MM-dd hh-mm-ss". But I'm unable to do this easily because:
1. It is not possible to pass "Second" as 2nd parameter to FormatDate
2. It is not possible to specify "hh-mm-ss" part of flexible formating pattern

Please implement at least one of the items or advise if I miss something.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8971
Re: FormatDate improvements
« Reply #1 on: June 20, 2010, 06:22:36 am »

It's been asked a few times, but so far, "Time" is not possible via formatdate().

hh-mm-ss are available from the [Date (Filename Friendly)] field, so you could create a new calculated data field using something like so:

mid([Date (Filename Friendly)],0,4)-mid([Date (Filename Friendly)],4,2)-mid([Date (Filename Friendly)],6,2) mid([Date (Filename Friendly)],9,2)-mid([Date (Filename Friendly)],11,2)-mid([Date (Filename Friendly)],13,2)

Will give you: yyyy-mm-dd hh-mm-ss

If you prefer, you could create two custom fields, one for the date, and one for the time, and then use them as you wish in your naming templates:

Date: mid([Date (Filename Friendly)],0,4)-mid([Date (Filename Friendly)],4,2)-mid([Date (Filename Friendly)],6,2)
Returns: yyyy-mm-dd

Time: mid([Date (Filename Friendly)],9,2)-mid([Date (Filename Friendly)],11,2)-mid([Date (Filename Friendly)],13,2)
Returns: hh-mm-ss

regards,
-marko

leoric

  • World Citizen
  • ***
  • Posts: 164
Re: FormatDate improvements
« Reply #2 on: June 20, 2010, 07:41:12 am »

Thanks marko.
Actually I recollect this pattern, I used it some time ago with MC13. But recently I've noticed that FormatDate is able to handle hours and minutes (by passing Hour or Minute as second parameter) so I'm wondering why seconds and hh-mm-ss are not handled.
Logged
Pages: [1]   Go Up