Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27201

VS 2010 DateConverter Class - Convert Nepali Date (BS) to English Date (AD) and vice versa

$
0
0
This object prototype lets you convert Nepali Date (i.e. BS) to English Date (i.e. AD) and vice versa and perform Unix Timestamp conversions

Limitation: Only works between the range 1994 AD - 2033 AD ( 2000 BS - 2089 BS )

Code:

        'Example #1
        Dim DC as New DateConverter(New Date(1996, 1, 21))
        MessageBox.Show("Date in BS : " & DC.ToBS())
        MessageBox.Show("Unix Timestamp: " & DC.GetUnixTimeStamp())
       
        Example #2
        Dim DC as New DateConverter()
        MessageBox.Show("1996/1/21 in BS : " & DC.ToBS(New Date(1996,1,21))
        MessageBox.Show("2052/10/7 in AD : " & DC.ToAD(New Date(2052,10,7))
        MessageBox.Show("Date from Unix Timestamp: " & DC.GetUnixTimeStamp(114804000))

Attachment 95223
Attached Files

Viewing all articles
Browse latest Browse all 27201

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>