Advertisement
stevennathaniel

Ubah Format Data dari 201612 Ke Desember 2016

Feb 20th, 2017
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.50 KB | None | 0 0
  1. Imports System
  2.  
  3. Imports System.Globalization
  4.  
  5. Module Module1
  6.  
  7.     Sub Main()
  8.  
  9.         Dim tanggal1 As String = "201612"
  10.  
  11.         Dim format As String
  12.  
  13.         Dim tanggal2 As Date
  14.  
  15.         Dim provider As Globalization.CultureInfo = Globalization.CultureInfo.InvariantCulture
  16.  
  17.         format = "yyyyMM"
  18.  
  19.         tanggal2 = Date.ParseExact(tanggal1, format, provider)
  20.  
  21.         Console.WriteLine(tanggal2.ToString("MMMM yyyy"))
  22.  
  23.         Console.ReadLine()
  24.  
  25.  
  26.     End Sub
  27.  
  28. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement