Last active
August 29, 2015 14:03
-
-
Save ChatchaiJ/6a45b00fd29dd2237055 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w- | |
use strict; | |
use warnings; | |
use DateTime; | |
use Data::Dumper; | |
my $locale = DateTime->DefaultLocale; | |
print Dumper($locale); | |
print "Default locale = " . $locale->id . "\n"; | |
my $new_locale = 'th_TH.UTF-8'; | |
print "Set new default locale to '$new_locale'\n"; | |
DateTime->DefaultLocale($new_locale); | |
$locale = DateTime->DefaultLocale->id; | |
print "Default locale = $locale\n"; | |
$locale = DateTime->DefaultLocale('en_US'); | |
print "locale = $locale->{'id'} \n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment