Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Getting day of the week from %last_modified% (Read 3101 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Getting day of the week from %last_modified%

I would like to get the day of the week (Monday, Tuesday etc.) from %last_modified%.

Is this possible?

As far as I can see foobar's time functions {here: $day_of_month(%last_modified%)} always deliver values formatted as digits.

Thank you in advance.

Robertina.
This is HA. Not the Jerry Springer Show.

Getting day of the week from %last_modified%

Reply #1
via search I found this thread and code -

http://www.hydrogenaudio.org/forums/index....mp;#entry607700

Code: [Select]
$select($add($mod($add(
$mul(2,$sub(3,$mod($left($year(%last_modified%),2),4))),
$right($year(%last_modified%),2),
$div($right($year(%last_modified%),2),4),
$select($month(%last_modified%),$ifequal($mod($year(%last_modified%),4),0,6,0),
$ifequal($mod($year(%last_modified%),4),0,2,3),3,6,1,4,6,2,5,0,3,5),
$day_of_month(%last_modified%)),
7),1),Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday)

Getting day of the week from %last_modified%

Reply #2
Before posting I searched the forum for day of the week and got an error saying "One or all of your search keywords were below 3 characters or you searched for words which are not allowed, such as 'html', 'img', etc, please go back and increase the length of these search keywords or choose different keywords." and I didn't know how to search more successful.

Thank you, trout, for your help, the code works well.
This is HA. Not the Jerry Springer Show.

Getting day of the week from %last_modified%

Reply #3
here's how I searched -

keywords: +day +week
search where: --foobar2000
result type: Show results as posts

hope that helps

Getting day of the week from %last_modified%

Reply #4
If anyone still occasionally uses foobar 0.9.5.2 for an extension that never got updated (I'm looking at you, Graphical Browser!), you won't have the time/date functions (year, month, day_of_month) and can use substr instead. A giveaway that this is happening to you: all of your days are coming up "Saturday".

foobar2000 0.9.5.2 compatible code:
Code: [Select]
$select($add($mod($add(
$mul(2,$sub(3,$mod($left($substr(%last_modified%,0,4),2),4))),
$right($substr(%last_modified%,0,4),2),
$div($right($substr(%last_modified%,0,4),2),4),
$select($substr(%last_modified%,6,7),$ifequal($mod($substr(%last_modified%,0,4),4),0,6,0),
$ifequal($mod($substr(%last_modified%,0,4),4),0,2,3),3,6,1,4,6,2,5,0,3,5),
$substr(%last_modified%,9,10)
),7),1),Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday)

Getting day of the week from %last_modified%

Reply #5
^eh? graphical browser works fine on the latest foobar.