Minggu, 01 Mei 2011

Best Words Ever!!

The world ain't all sunshine and rainbows.
It's very mean and nasty place.
And I don't care how tough you are,
I'll beat you to your knees and keep you there permanently,
if you let it, you, me or nobody is gonna hit as hard as life.
But it ain't about how hard you hit
it's about how hard you can get hit and moving forward,
how much you can take and keep moving forward.
that's how winning is done,
Now, if you know what you worth,
but you gotta be willing to take the hits
and not pointing finger saying:
"You ain't what you wanna be because of him or her or anybody."
cowards do that and that ain't you!
You're better than that.
(Rocky Balboa)

Jumat, 29 April 2011

Convert String to Date dalam VB.net

Akhirnya bikin blog baru juga,
ceritanya blog ini mo gw peke buat post Fan Fict, tapi kayanya kalo itu doang bakalan boring. Jadi mo gue isi macem-macem, mungkin Chord gitar, coding, query, Fan Fiction, ato mungkin cuma foto2 n video geje.hahaha..suka2 gw aja jadi jangan sampe puasa ato mandi kembang 7 rupa buat mikirin APA SIH TEMA BLOG BARU GIES? (Kalimat gak penting)
so, kita langsung fokus aja sama inti posting pertama gue ini. hari ini gw terinspirasi coding keren, lumayan otak gw lagi bener, mungkin buat sebagian besar ini post gak penting tapi buat orang kayak gw yang otaknya lebih sering gak bener code ini bener2 harus diposting biar gak ilang.hehe..temuan gue loh.. (LOL)

    Sub coba()
        Dim x As String
        Dim y As Date
        x = TextBox1.Text
        x = x.Substring(0, 2) & "/" & x.Substring(2, 2) & "/" & x.Substring(4, 4)
        y = Date.Parse(x).ToShortDateString
        DateTimePicker1.Value = y
    End Sub
   
konsepnya gw bikin textbox1 dulu buat nampung tanggal format string dari database, trus isi textbox1 itu nantinya gw convert k format short date, kl mo format long date di propertiesnya aja tinggal diubah, tar nyesuein kok codingnya :D
semoga membantu >_<