Converting Date from French to Taiwanese

by Jan 31, 2013

Date and Time formats are highly culture-specific, so often you need to convert date and time from one cultural format to another. That's pretty straight-forward. All you need to know are the culture IDs to convert from and convert to.

This line will list all culture infos so you can easily pick the culture name from the column "Name":

PS> [System.Globalization.CultureInfo]::GetCultures('AllCultures') | Sort-Object DisplayName

And this example takes a French date and returns it in Taiwanese format:

$dateFrench = 'vendredi 23 novembre 2012 11:19:13'

[System.Globalization.CultureInfo]$French = 'fr-FR'
[System.Globalization.CultureInfo]$Taiwan = 'zh-TW'

$DateTime = [datetime]::Parse($dateFrench, $French)

$dateTaiwan = $DateTime.ToString($Taiwan)

Twitter This Tip! ReTweet this Tip!