Our Products
Classes
BMP
Crypto
CSVStrings
DataLogger
Dates
DebugRecorder
FileNameSet
FileSender
RDOConnectMaster
ReportAids
Sheller
StringSet
WEBUtilities
Modules
DAOLib
Globals
Registry
Programs
Batcher
HTMLGen
KillTime
TimedMessage
|
Dates: This class takes some of the worry out of handling dates. It establishes three date formats:
- the one your system is set to
- a standard format that looks like mm/dd/yyyy
- a Y2K format that looks like yyyymmdd.
Then it provides the functions to easily move between the formats.
AdvanceDate provides a method for incrementing a date by any multiple of seconds, minutes, hours, days, weeks,
months, or years.
FormatInputDate provides a short-hand way of inputting dates by taking advantage of the current calendar information. Inputs like dd, mm/dd, mm/dd/yy, and mm/dd/yyyy are all properly interpreted.
This class arose out of a need to simplify and make date conversions consistent across all applications. To see the full interface definition of Dates, scroll down. |
|
|
Dates is a small set of date conversion funtions that make life with the Date type a little easier. The AdvanceDate
function is particularly useful for manipulating periodic events. Below is the interface defintion for the Class. |
Sub AdvanceDate(InDate As Date, IntvlType As String, Intvl As Integer)
' Advance entry time
' Intvl Types are: Y -year, M -month, W -week, D -day, H -hour,
' I -minute, S -second
' InDate is modified by adding Interval periods of IntvlType to itself.
Function CreateDateTime(ADate As String, ATime As String) As Date
' Creates date/time stamp
Function Date2KToDate(dt) As Date
' Format yyyymmdd as Date
Function Date2KToStdDate(dt) As String
' Format yyyymmdd as mm/dd/yyyy
Function DateTo2KDate(dt As Date) As String
' Format date as yyyymmdd
Function DateToStdDate(dt As Date) As String
' Format date as mm/dd/yyyy
Function FormatDateTime2K(A As Date) As String
' Format date as yyyymmddhhmmss
Function FormInputDate(Inp As String) As String
' Accepts/formats short-hand date inputs
' Short-hand date entries are turned into mm/dd/yyyy
' Formats are d, dd, mdd, mmdd, mmddyyyy, mm/dd/yyyy
' Current month and/or year default when not provided in input string
Function StdDateTo2KDate(dt As String) As String 'mm/dd/yyy ==> yyyymmdd
Function StdDateToDate(dt As String) As Date 'mm/dd/yyy ==> Date
|
|