|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
Filename: sfldate.h
Package: Standard Function Library (SFL)
Written: 1996/01/05 iMatix SFL project team sfl@imatix.com
Revised: 1998/08/05
Copyright: Copyright (c) 1996-2000 iMatix Corporation
Includes functions to get the current date/time, calculate the day or week, week of year and leap year. Dates and times are each stored in a 32-bit long value of 8 digits: dates are CCYYMMDD; times are HHMMSSCC. You can compare dates and times directly - e.g. if (date_wanted >= date_now).
sfldate.h defines these symbols, possibly conditionally:
| Symbol: | Defined as: |
|---|---|
| DAY_FRIDAY | 5 |
| DAY_MONDAY | 1 |
| DAY_SATURDAY | 6 |
| DAY_SUNDAY | 0 |
| DAY_THURSDAY | 4 |
| DAY_TUESDAY | 2 |
| DAY_WEDNESDAY | 3 |
| GET_CCYEAR(d) | (int) ( (d) / 10000L) |
| GET_CENTI(t) | (int) ( (t) % 100) |
| GET_CENTURY(d) | (int) ( (d) / 1000000L) |
| GET_DAY(d) | (int) ( (d) % 100) |
| GET_HOUR(t) | (int) ( (t) / 1000000L) |
| GET_MINUTE(t) | (int) (((t) % 1000000L) / 10000L) |
| GET_MONTH(d) | (int) (((d) % 10000L) / 100) |
| GET_SECOND(t) | (int) (((t) % 10000L) / 100) |
| GET_YEAR(d) | (int) (((d) % 1000000L) / 10000L) |
| INTERVAL_CENTI | 1 |
| INTERVAL_DAY | 8640000L |
| INTERVAL_HOUR | 360000L |
| INTERVAL_MIN | 6000 |
| INTERVAL_SEC | 100 |
| MAKE_DATE(c,y,m,d) | (long) (c) * 1000000L + |
| MAKE_TIME(h,m,s,c) | (long) (h) * 1000000L + |
| SFLDATE_INCLUDED | TRUE |
| timeeq(d1,t1,d2,t2) | ((d1) == (d2) && (t1) == (t2)) |
| timege(d1,t1,d2,t2) | ((d1) > (d2) || ((d1) == (d2) && (t1) >= (t2))) |
| timegt(d1,t1,d2,t2) | ((d1) > (d2) || ((d1) == (d2) && (t1) > (t2))) |
| timele(d1,t1,d2,t2) | ((d1) < (d2) || ((d1) == (d2) && (t1) <= (t2))) |
| timelt(d1,t1,d2,t2) | ((d1) < (d2) || ((d1) == (d2) && (t1) < (t2))) |
| timeneq(d1,t1,d2,t2) | ((d1) != (d2) || (t1) != (t2)) |
| | << | < | > | >> |
|