Results 1 to 5 of 5

Thread: How do I get if today is daylight savings time?

  1. #1

    How do I get if today is daylight savings time?

    In VBasic it's:

    Dim DST as Boolean

    DST=DateTime.Now.IsDaylightSavingsTime()


    Thanks......

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Not so clear approach but here an example using API:
    
    TYPE SYSTEMTIME
      wYear As Word
      wMonth As Word
      wDayOfWeek As Word
      wDay As Word
      wHour As Word
      wMinute As Word
      wSecond As Word
      wMilliseconds As Word
    End Type
    
    
    
    
    Type TIME_ZONE_INFORMATION
      Bias As Long
      StandardName As String * 64
      StandardDate As SYSTEMTIME
      StandardBias As Long
      DaylightName As String * 64
      DaylightDate As SYSTEMTIME
      DaylightBias As Long
    End Type
    
    
    %TIME_ZONE_ID_INVALID  = &HFFFFFFFF As DWord
    %TIME_ZONE_ID_UNKNOWN  = 0
    %TIME_ZONE_ID_STANDARD = 1
    %TIME_ZONE_ID_DAYLIGHT = 2
    
    
    
    
    Declare Function GetTimeZoneInformation Lib "KERNEL32.DLL" Alias "GetTimeZoneInformation" (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As DWord
    
    
    Dim MyTZ As TIME_ZONE_INFORMATION 
    Dim lRet As Long
    
    
    lret = GetTimeZoneInformation(MyTZ)
    
    
    If lRet = %TIME_ZONE_ID_DAYLIGHT Then
      MsgBox 0, "GetTimeZoneInformation returned %TIME_ZONE_ID_DAYLIGHT"
    Else
      MsgBox 0, "GetTimeZoneInformation returned " & lRet
    End If
    
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Reference for GetTimeZoneInformation API fucntion:

    http://msdn.microsoft.com/en-us/libr...21(VS.85).aspx
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4

    Wowwww

    Man-O-Man.... all that?
    Thanks for the help - it works.

    How about adding that to "DT"

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Quote Originally Posted by steinie View Post
    How about adding that to "DT"
    Yes, sure.

    Can you be so kind to open a request into support are under thinBasic feature requests?
    http://www.thinbasic.com/community/p...typeid=feature

    If not I will create for you.

    Thanks
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Similar Threads

  1. Google Logo Today
    By zak in forum Shout Box Area
    Replies: 3
    Last Post: 11-06-2011, 09:40
  2. Today server restart
    By ErosOlmi in forum Web and Forum
    Replies: 1
    Last Post: 25-10-2009, 13:22

Members who have read this thread: 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •