date type?
#10
(03-01-2023, 02:40 PM)Balderdash Wrote: One could do it with Win32 API but I don't have the code handy right now. This is a good reference if you know what you're doing. If not, I can assist.

SYSTEMTIME (minwinbase.h) - Win32 apps | Microsoft Learn

Simple conversion of the small sample at the bottom of that page:

Code: (Select All)
Option Explicit
$NoPrefix
$Console:Only

Type SYSTEMTIME
    As Unsigned Integer wYear, wMonth, wDayOfWeek
    As Unsigned Integer wDay, wHour, wMinute
    As Unsigned Integer wSecond, wMilliseconds
End Type

Declare CustomType Library
    Sub printf (format As String, Byval arg1 As Unsigned Integer, Byval arg2 As Unsigned Integer)
    Sub GetSystemTime (ByVal lpSystemTime As Offset)
    Sub GetLocalTime (ByVal lpSystemTime As Offset)
End Declare

Dim As SYSTEMTIME st, lt

GetSystemTime (Offset(st))
GetLocalTime (Offset(lt))

printf "The system time is: %02d:%02d" + Chr$(10) + Chr$(0), st.wHour, st.wMinute
printf " The local time is: %02d:%02d" + Chr$(10) + Chr$(0), lt.wHour, lt.wMinute

Good to know about! 
However, I was thinking of something a little more cross-platform...
Reply


Messages In This Thread
date type? - by madscijr - 02-28-2023, 08:14 AM
RE: date type? - by mnrvovrfc - 02-28-2023, 09:21 AM
RE: date type? - by madscijr - 02-28-2023, 01:04 PM
RE: date type? - by mnrvovrfc - 02-28-2023, 02:22 PM
RE: date type? - by TerryRitchie - 02-28-2023, 07:50 PM
RE: date type? - by madscijr - 03-01-2023, 01:56 AM
RE: date type? - by mnrvovrfc - 03-01-2023, 03:37 AM
RE: date type? - by SMcNeill - 03-01-2023, 09:58 AM
RE: date type? - by bplus - 03-01-2023, 04:05 PM
RE: date type? - by madscijr - 03-01-2023, 05:29 PM
RE: date type? - by mnrvovrfc - 03-01-2023, 10:11 PM
RE: date type? - by SpriggsySpriggs - 03-01-2023, 02:40 PM
RE: date type? - by madscijr - 03-01-2023, 03:27 PM
RE: date type? - by mnrvovrfc - 03-01-2023, 04:16 PM
RE: date type? - by SpriggsySpriggs - 03-01-2023, 04:31 PM
RE: date type? - by Kernelpanic - 03-01-2023, 06:31 PM
RE: date type? - by TerryRitchie - 03-01-2023, 06:55 PM
RE: date type? - by madscijr - 03-01-2023, 09:18 PM
RE: date type? - by SMcNeill - 03-02-2023, 02:23 AM
RE: date type? - by bplus - 03-02-2023, 02:35 AM
RE: date type? - by madscijr - 03-02-2023, 06:48 PM



Users browsing this thread: 7 Guest(s)