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:
pisy_rasfatata
Femeie
23 ani
Bucuresti
cauta Barbat
23 - 55 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: 739
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: 739
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: 739
TBA more


pus acum 1 an
   
TRaP
Moderator

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


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


pus acum 1 an
   
Pagini: 1  

Mergi la