Skip to content

Instantly share code, notes, and snippets.

@michaeloffner
Created February 12, 2015 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaeloffner/7c02d34625d10853fea7 to your computer and use it in GitHub Desktop.
Save michaeloffner/7c02d34625d10853fea7 to your computer and use it in GitHub Desktop.
locales and timezone
<cfscript>
// outputs a data with a specifc locale and a specific timezone
regionals={
"Europe/Zurich":"de_ch",
"America/Los_Angeles":"en_us",
"Australia/Perth":"en_au",
"Asia/Ho_Chi_Minh":"vi_VN",
"Asia/Shanghai":"zh_CN"
};
loop struct="#regionals#" index="timezone" item="locale" {
dump(
label:"What's the time in #timezone.replace('_',' ','all').listLast('/')#",
var:lsDateTimeFormat(date:now(),locale:locale,timezone:timezone,mask:"long"));
}
// some roman numbers maybe
dump(
label:'We write the year',
var:numberFormat(now().year(),"roman"));
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment