West calendar and calendar Conversion

Source: Internet
Author: User

Dim dT as date
Console. writeline (datevalue ("H20/10/12"). Date. tow.datestring)
Datetime. tryparseexact ("20081010", "yyyymmdd", nothing, globalization. datetimestyles. None, DT)

Dim CI as cultureinfo = new cultureinfo ("Ja-JP ")
Dim Cal as calendar = new japanesecalendar
CI. datetimeformat. Calendar = new japanesecalendar

Dim strwri as string = CI. datetimeformat. getabbreviatederaname (calendar. currename) + dt. tostring ("YY/MM/DD", CI)
Console. writeline (Dt. Date. tostring ("gyy/MM/DD", CI ))
Console. writeline (strwri)

console. writeline (Cal. maxsupporteddatetime. tostring)

for each name as string in CI. datetimeformat. abbreviateddaynames
console. writeline (name)
next
for each name as string in CI. datetimeformat. dateseparator
console. writeline (name)
next
strwri = DT. tostring ("gyy/MM/DD", CI) + "(" + ci. datetimeformat. getabbreviateddayname (DT. dayofweek) + ")" + _
Ci. datetimeformat. getmonthname (DT. month)
console. writeline (strwri)

'dim CI as cultureinfo = new cultureinfo ("Ja-JP")
'dim Cal as calendar = new japanesecalendar
'Ci. datetimeformat. calendar = Cal
dim era as string () = {"M", "T", "S", "H"}
console. writeline (CI. datetimeformat. geteraname (Cal. geode (DT) & DT. tostring ("YY/MM/DD", CI)
console. writeline (ERA (Cal. geode (DT)-1) & DT. tostring ("YY/MM/DD", CI)
console. writeline (ERA (Cal. geode (DT)-1) & Cal. getyear (DT) & DT. tostring ("/MM/DD", CI)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.