Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
dela_dela
Femeie
24 ani
Bucuresti
cauta Barbat
24 - 48 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [VBS] Working With Dates Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 787
dte = FormatDateTime(Now(), 2)
returns the current date as per your regional formatting (eg. 03/14/2023), in my case: 14.03.2023

Options for the 2nd argument:

    0 = vbGeneralDate - Default. Returns date: mm/dd/yyyy and time if specified: hh:mm:ss PM/AM.
    1 = vbLongDate - Returns date: weekday, monthname, year
    2 = vbShortDate - Returns date: mm/dd/yyyy
    3 = vbLongTime - Returns time: hh:mm:ss PM/AM
    4 = vbShortTime - Return time: hh:mm

Source:

Modificat de TRaP (acum 1 an)


pus acum 1 an
   
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 787
Format the date the way you want, for example format today's date as: 2023-03-14


    d = Day(Now())
    If Len(d) = 1 Then
        d = "0" & Day(Now())
    End If
   
    m = Month(Now())
    If Len(m) = 1 Then
        m = "0" & Month(Now())
    End If

    y = Year(Now())
   
    strDate = y & "-" & m & "-" & d


Source:


pus acum 1 an
   
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 787
TBA more


pus acum 1 an
   
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 787
For hour, minute and second:


Hour(Now)
Minute(Now)
Second(Now)


pus acum 1 an
   
Pagini: 1  

Mergi la