INTERACT FORUM

Please login or register.

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

Author Topic: How to change the date format to yyyy/mm/dd?  (Read 7563 times)

Otello

  • World Citizen
  • ***
  • Posts: 204
How to change the date format to yyyy/mm/dd?
« on: February 02, 2016, 09:08:39 am »

Hi guys, I have a problem with the Date field: is it possible to change the date format to yyyy/mm/dd?

I'm asking because I group with an expression to sort my album by Date (something like Artist-Date-Album-Publisher), it works if I use only the year, but with a full date (mm/dd/yyyy) my sorting get broken, (for instance 1/8/2015 is listed before 2000), to make it work I'd need to show the full date as yyyy/mm/dd.

Thanks
Marco
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42053
  • Shoes gone again!
Re: How to change the date format to yyyy/mm/dd?
« Reply #1 on: February 02, 2016, 09:26:26 am »

You can use this expression:
FormatDate([Date, 0], yyyy//mm//dd)

But that won't format real nicely for year-only dates.  Hopefully you won't have any of those.
Logged
Matt Ashland, JRiver Media Center

wburkett

  • World Citizen
  • ***
  • Posts: 109
Re: How to change the date format to yyyy/mm/dd?
« Reply #2 on: February 02, 2016, 09:35:28 am »

It would be nice if we could do this directly in all of the date fields.  (If I'm not mistaken, I think this only works when you "re-cast" an existing date field into another user-field.)
Logged

CountryBumkin

  • Citizen of the Universe
  • *****
  • Posts: 3352
Re: How to change the date format to yyyy/mm/dd?
« Reply #3 on: February 02, 2016, 10:04:32 am »

Sounds like the problem is related to Sorting and not really the date format.
Date sorting should be by oldest to newest (or vice versa).
Logged

Otello

  • World Citizen
  • ***
  • Posts: 204
Re: How to change the date format to yyyy/mm/dd?
« Reply #4 on: February 02, 2016, 10:48:45 am »

Sounds like the problem is related to Sorting and not really the date format.
Date sorting should be by oldest to newest (or vice versa).

Mmmm, I tjink you're right.

Fact is, if I use Date alone it's sorted correctly, for instance if I use the column "Date" in the upper part of Panes.
The problem is with album grouping, I only can sort it a>z or z>a, so I was looking for a workaround like putting the year before day and month.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: How to change the date format to yyyy/mm/dd?
« Reply #5 on: February 02, 2016, 11:52:11 am »

if you use in an expression column

convertdate([date])

it will convert the dates to the numeric unreadable string, but if you sort on this column it should work

dates without dd/mm (i.e. just year) will sort before the rest of the dates
2010
1/1/2010
1/2/2010

It would be nice if we could do this directly in all of the date fields.  (If I'm not mistaken, I think this only works when you "re-cast" an existing date field into another user-field.)

i think you're mistaken (or i misunderstand you), the "normal" date fields (meaning any that are user changeable) can be modified with any expression
Logged

rudyrednose

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 344
  • nothing more to say...
Re: How to change the date format to yyyy/mm/dd?
« Reply #6 on: February 02, 2016, 01:19:31 pm »

Dates are a mine field...
1/2/2016 and 1/2/2016 are not the same date, if you are american or french.
Worse was before 2013, we got some 1/2/3 dates  ::)

Personally, I systematically use the ISO format, 2016-01-02 (yyyy-mm-dd).  There is NO ambiguity, and bonus :
- the alpha sort is also chronological.
- no escape sequence required for the dash
Logged

Otello

  • World Citizen
  • ***
  • Posts: 204
Re: How to change the date format to yyyy/mm/dd?
« Reply #7 on: February 02, 2016, 02:50:36 pm »


Personally, I systematically use the ISO format, 2016-01-02 (yyyy-mm-dd).  There is NO ambiguity, and bonus :


Ehm, it is exactly what I'll like to do! :-)
But JR convert the dates in mm/dd/yyyy whatever format I use...
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: How to change the date format to yyyy/mm/dd?
« Reply #8 on: February 02, 2016, 03:43:42 pm »

why don't you just use either a column or a field and convert to the absolute date?

i've tested and it works well including inside of groupings...it's maybe not ideal but you can group by absolute date and still view by regular date...
Logged

wburkett

  • World Citizen
  • ***
  • Posts: 109
Re: How to change the date format to yyyy/mm/dd?
« Reply #9 on: February 02, 2016, 04:08:53 pm »

Personally, I systematically use the ISO format, 2016-01-02 (yyyy-mm-dd).  There is NO ambiguity, and bonus :
- the alpha sort is also chronological.
- no escape sequence required for the dash

Me, too - that's exactly what I want all dates to look like.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: How to change the date format to yyyy/mm/dd?
« Reply #10 on: February 02, 2016, 05:43:42 pm »

Personally, I systematically use the ISO format, 2016-01-02 (yyyy-mm-dd).  There is NO ambiguity, and bonus :
- the alpha sort is also chronological.
- no escape sequence required for the dash

I would prefer to use that format everywhere as well, at least for display and data entry. I don't care how it is stored I MC, and as above, I suspect it is stored as an "absolute date" number. Do you actually do something in MC to force use of that format, or have you created separate fields, or what have you done?


Another thought is that MC already has a field "Date(filename friendly)" that formats the date to yyyymmdd-tttttt. Would that meet the above requirement for sorting? The field seems to fill a yyyy (year only supplied) value to yyyy0101-000000, so anything without mmdd would be sorted to the beginning of the year.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

rudyrednose

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 344
  • nothing more to say...
Re: How to change the date format to yyyy/mm/dd?
« Reply #11 on: February 02, 2016, 10:02:57 pm »

Do you actually do something in MC to force use of that format, or have you created separate fields, or what have you done?

I had nothing to do in MC.  
I set up my Windows machines from day 1 to use dates in ISO format (yyyy-mm-dd HH:MM).  Always have.

Basic install of MC seems to have followed the OS, and dates are as I like them.

----

Just an idea, you may want to try:
1- backup your library
2- create a new Windows local user
3- logon in Windows as the new user
4- set him up for ISO dates
5- launch MC (this should be a new library)
6- restore the library backup

Look at a detailed view, showing the Date tag.  Maybe you'll be surprised. (I have not tried it)
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: How to change the date format to yyyy/mm/dd?
« Reply #12 on: February 02, 2016, 10:45:23 pm »

I had nothing to do in MC.  
I set up my Windows machines from day 1 to use dates in ISO format (yyyy-mm-dd HH:MM).  Always have.

Yup. It displays dates following the system environment preferences. You don't even have to restart MC.

* In Windows 10: go to Start and type: Change date and time formats. Change the Short Date format to your preferred style. MC changes immediately.
* I don't remember how to do it in Windows 7 and 8, but it was basically the same thing (they've changed the panel over the years, but you could always specify the default short and long date formats).

Of course...

If you want to display any kind of date, formatted however you want, wherever you want in MC, you can just make a calculated field that reformats the particular [Date] you want to the proper format. Then use this field instead everywhere for display where you want to see it (add it as columns or categories or whatever throughout MC).

I use this heavily in Theater View, to customize and shorten what shows on screen, and I've explained how I do this for some fields here:
https://yabb.jriver.com/interact/index.php?topic=85974.0
https://yabb.jriver.com/interact/index.php?topic=88998.0
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: How to change the date format to yyyy/mm/dd?
« Reply #13 on: February 02, 2016, 11:12:14 pm »

I had nothing to do in MC.  
I set up my Windows machines from day 1 to use dates in ISO format (yyyy-mm-dd HH:MM).  Always have.

Basic install of MC seems to have followed the OS, and dates are as I like them.

Yup. It displays dates following the system environment preferences. You don't even have to restart MC.

Excellent. Done. I'll see if that cause a negative shift the in WAF.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

wburkett

  • World Citizen
  • ***
  • Posts: 109
Re: How to change the date format to yyyy/mm/dd?
« Reply #14 on: February 03, 2016, 10:09:58 am »

Great idea, Roderick - it works!!!!

Logged

Otello

  • World Citizen
  • ***
  • Posts: 204
Re: How to change the date format to yyyy/mm/dd?
« Reply #15 on: February 03, 2016, 12:01:41 pm »

OK, the trick worked, thanks.  ;D

(For the record, Glynor' method didn't work for me (maybe because the Italian Windows?): the short format pull down menu offer me only variation of the european standard:
dd/MM/yyyy, dd/MMM/yyyy, dd/MM/yy, etc.;
the Win 10 settings do not allow to input manually  the yyyy/MM/dd format; to force the format I had to do from Control Panel.)

As I use JR on a dedicated PC, for me changing the system setting is not a problem, but I'd really like to have this setting inside JR; of course I have no idea if it's  trivial or complicated to make. (?)
Logged
Pages: [1]   Go Up