INTERACT FORUM

Please login or register.

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

Author Topic: Quick Expression question used for updating a tag  (Read 344 times)

David Sydney

  • Galactic Citizen
  • ****
  • Posts: 377
Quick Expression question used for updating a tag
« on: January 07, 2021, 10:04:37 pm »

Folks - what am I missing. I am trying to tag some home video Album tag with the day-month-year of the recorded file. But I missing something as it's not making sense.

In Album tag I have put "=formatdate([Date], d//MM//yyyy)"  in order to pick up 19/02/2017 (AU format) but it returns 18/01/1900?! if I put in [ just [Date] it returns exactly as written in the date field "19/02/2017 12:24 pm" but I do not want the time stamp. Does it have something to do with not reading the Date field due to non US format?

Before I get slammed by the more senior members which seems increasingly common now;...  Yes I have read the Wiki page on expression, yes I have tried to verify this is indeed the Date field I am trying to read. I can't use [Date (day)]//[Date (month)]... etc because I don't won't a text named month I want a numeric one. There are probably many ways to do this but seems I am missing something simple? I have used expressions successfully in F6 Move, Copy operations for some time but new to trying to manipulate tags with them.

Thanks in advance...
Logged
Dave
------
Linux Manjaro 24 / Windows 10 Pro | i7 14700K Gigabyte Z790 UD AX | JRMark 10253 | Realtek Integrated HDAudio SPDIF | PC Sound = 1/ Yamaha TSS-15 5.1 Speaker System, 2/ SMSL SU-1 DAC + TA-66 Tube Headphone Amp + Klipsch ProMedia Heritage 2.1 Speakers | HiFi Sound = 1/ Network DLNA to WiiM Ultra Streamer + Advaned Paris A10 Amp in Music Room, 2/ DLNA to Yamaha RX-V777 AV Receiver in Living Room & Outside Deck, 3/ DLNA to Paired Yamaha WiFi WX-010 MusicCast Speakers to Outside Areas

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Quick Expression question used for updating a tag
« Reply #1 on: January 07, 2021, 10:19:50 pm »

You skipped over this part:
Quote
The date value is a Media Center internal floating-point date/time representation, stored in Date fields, and output from various functions such as Now() and ConvertDate(). To pass a field of type Date to FormatDate(), use the raw (unformatted) field specification, such as "[Date Imported,0]".

You have everything else right, but you're passing the [Date] field in the wrong format, because you didn't include the ,0 on the end of the date field to get the raw data.

So you need:
formatdate([Date,0], d//MM//yyyy)

Several examples are given at the bottom of the FormatDate() wiki page, and they include the ,0 with the field name, although they use date fields other than just plain old [Date]

The [Date] field, unless told otherwise, outputs in a friendly format. There are a few circumstances in the expression language where you have to distinguish between formatted and raw data, and this is one of them.  But a lot of people aren't aware of this sort of distinction.

Logged

David Sydney

  • Galactic Citizen
  • ****
  • Posts: 377
Re: Quick Expression question used for updating a tag
« Reply #2 on: January 08, 2021, 02:56:38 am »

Aaa-Ha! Thank you Wer. Indeed the implications of that simple element ",0" were lost on me. It's amazing the depth of detail that exists in the JRiver environment and the knowledge on this forum from people like yourself. With that expression it let me fix 1200+ video files in about 2min, that just imported from DV tape capture. I have that unfinished task cluttering the back of my mind - and that tapes lying around - for 10-15 years. Thanks again.
Logged
Dave
------
Linux Manjaro 24 / Windows 10 Pro | i7 14700K Gigabyte Z790 UD AX | JRMark 10253 | Realtek Integrated HDAudio SPDIF | PC Sound = 1/ Yamaha TSS-15 5.1 Speaker System, 2/ SMSL SU-1 DAC + TA-66 Tube Headphone Amp + Klipsch ProMedia Heritage 2.1 Speakers | HiFi Sound = 1/ Network DLNA to WiiM Ultra Streamer + Advaned Paris A10 Amp in Music Room, 2/ DLNA to Yamaha RX-V777 AV Receiver in Living Room & Outside Deck, 3/ DLNA to Paired Yamaha WiFi WX-010 MusicCast Speakers to Outside Areas

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Quick Expression question used for updating a tag
« Reply #3 on: January 08, 2021, 03:15:40 am »

You're welcome.
Logged
Pages: [1]   Go Up