Help - Search - Members - Calendar
Full Version: Display date in custom ways?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Support - (fb2k)
Dj kourampies
i want to use the %last_played% tag on a trackinfo panel, but i dont like the way it displays the last played time like this:

(YYYY-MM-DD HH:MM:SS)

Is there any function to reformat it and display something like December 20th 2006, 16:40

or 20-12-06, 16:40?

I would appreciate any help, and especially code examples since i dont know anything about scripting... rolleyes.gif

Thanks in advance.
Yotsuya
I dont use playback stats but heres some code I whipped up you might find interesting:

CODE
$puts(string,2006-12-20 16:40:05)

$puts(month,$select($substr($get(string),$add($strchr($get(string),-),1),$sub($strrchr($get(string),-),1)),
January,February,March,April,May,June,July,August,September,October,November,December))

$puts(day,$substr($get(string),$add($strrchr($get(string),-),1),$sub($strrchr($get(string), ),1)))

$puts(suffix,$if2($select($substr($get(string),$sub($strrchr($get(string), ),1),$strrchr($get(string), )),
st,nd,rd),th))

$puts(year,$left($get(string),$sub($strchr($get(string),-),1)))

$puts(time,$substr($get(string),$add($strrchr($get(string), ),1),$sub($strrchr($get(string),:),1)))

$get(month) $get(day)$get(suffix) $get(year), $get(time)

* the suffix thing needs work
Lyx
also see these codesnippets:
http://wiki.hydrogenaudio.org/index.php?ti...and_LAST_PLAYED
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.