by Arun Banik (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 3rd August 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This simple but useful program is actually created by Tryambak Chatterjee, which keeps a record in date and time format when ever somebody
API Declarations
Dim yr As String
Dim lng As Integer
Dim rst As String
Dim mnth As String
Dim dt As String
Dim day As String
' Just do what has been mentioned by Tryambak. Copy and paste this code in form load event. Set the form's visible property to false. Create a folder named Log in C:\ drive. Create an Exe and save it in the startup folder and restart your computer.
Dim dystore As String
Dim mnstore As String
Dim mnthval
Dim totdt As String
Dim txt1, txt2, txt3 As String
tim = Time
dt = Date
lng = Len(dt)
yr = "20" + Right$(dt, 2) ' Get the year
rst = Left$(dt, (lng - 3))
mnth = Left$(dt, 2)
If Right$(mnth, 1) = "/" Then
mnth = Left$(mnth, 1)
End If
day = Mid$(rst, 3, 2) ' Get the 3rd and 4th value if its a two digit date
If Right$(day, 1) = "/" Then
day = Left$(day, 1)
End If
mnthval = Format(Date, "MMMM")
' SELECTING ST/ND/RD/TH AFTER THE DAY
If day = "1" Or day = "31" Then
dystore = day + "st"
Else
If day = "2" Or day = "22" Then
dystore = day + "nd"
Else
If day = "3" Or day = "23" Then
dystore = day + "rd"
Else
dystore = day + "th"
End If
End If
End If
' Total Date
'totdt = dystore + " " + mnstore + ", " + yr
totdt = dystore + " " + mnthval + ", " + yr
' Log Storing
Open "C:\Log\log.fil" For Append As #1
Write #1, tim, totdt
Close
End
End Sub
No comments have been posted about This simple but useful program is actually created by Tryambak Chatterjee, which keeps a record in . Why not be the first to post a comment about This simple but useful program is actually created by Tryambak Chatterjee, which keeps a record in .