FreeBASIC  0.91.0
fb_datetime.h
Go to the documentation of this file.
1 FBCALL double fb_Timer ( void );
2 FBCALL FBSTRING *fb_Time ( void );
3 FBCALL int fb_SetTime ( FBSTRING *time );
4 FBCALL FBSTRING *fb_Date ( void );
5 FBCALL int fb_SetDate ( FBSTRING *date );
6 
7  int fb_hSetTime ( int h, int m, int s );
8  int fb_hSetDate ( int y, int m, int d );
9 
10 
11 /**************************************************************************************************
12  * VB-compatible functions
13  **************************************************************************************************/
14 
15 typedef enum _eFbIntlIndex {
20 } eFbIntlIndex;
21 
22 #define FB_WEEK_FIRST_SYSTEM 0
23 #define FB_WEEK_FIRST_JAN_1 1
24 #define FB_WEEK_FIRST_FOUR_DAYS 2
25 #define FB_WEEK_FIRST_FULL_WEEK 3
26 #define FB_WEEK_FIRST_DEFAULT FB_WEEK_FIRST_JAN_1
27 
28 #define FB_WEEK_DAY_SYSTEM 0
29 #define FB_WEEK_DAY_SUNDAY 1
30 #define FB_WEEK_DAY_MONDAY 2
31 #define FB_WEEK_DAY_TUESDAY 3
32 #define FB_WEEK_DAY_WEDNESDAY 4
33 #define FB_WEEK_DAY_THURSDAY 5
34 #define FB_WEEK_DAY_FRIDAY 6
35 #define FB_WEEK_DAY_SATURDAY 7
36 #define FB_WEEK_DAY_DEFAULT FB_WEEK_DAY_SUNDAY
37 
38 #define FB_TIME_INTERVAL_INVALID 0
39 #define FB_TIME_INTERVAL_YEAR 1
40 #define FB_TIME_INTERVAL_QUARTER 2
41 #define FB_TIME_INTERVAL_MONTH 3
42 #define FB_TIME_INTERVAL_DAY_OF_YEAR 4
43 #define FB_TIME_INTERVAL_DAY 5
44 #define FB_TIME_INTERVAL_WEEKDAY 6
45 #define FB_TIME_INTERVAL_WEEK_OF_YEAR 7
46 #define FB_TIME_INTERVAL_HOUR 8
47 #define FB_TIME_INTERVAL_MINUTE 9
48 #define FB_TIME_INTERVAL_SECOND 10
49 
50 #define fb_hTimeDaysInYear( year ) \
51  (365 + fb_hTimeLeap( year ))
52 
53 FBCALL int fb_IsDate ( FBSTRING *s );
54 FBCALL int fb_DateValue ( FBSTRING *s );
55 FBCALL int fb_DateSerial ( int year, int month, int day );
56 FBCALL int fb_Year ( double serial );
57 FBCALL int fb_Month ( double serial );
58 FBCALL int fb_Day ( double serial );
59 FBCALL int fb_Weekday ( double serial, int first_day_of_week );
60 
61 FBCALL double fb_TimeValue ( FBSTRING *s );
62 FBCALL double fb_TimeSerial ( int hour, int minute, int second );
63 FBCALL int fb_Hour ( double serial );
64 FBCALL int fb_Minute ( double serial );
65 FBCALL int fb_Second ( double serial );
66 
67 FBCALL double fb_Now ( void );
68 
69 FBCALL FBSTRING * fb_MonthName ( int month, int abbreviation );
70 FBCALL FBSTRING * fb_WeekdayName ( int weekday, int abbreviation,
71  int first_day_of_week );
72 
73 FBCALL double fb_DateAdd ( FBSTRING *interval,
74  double interval_value_arg,
75  double serial );
76 FBCALL int fb_DatePart ( FBSTRING *interval, double serial,
77  int first_day_of_week,
78  int first_day_of_year );
79 FBCALL long long fb_DateDiff ( FBSTRING *interval,
80  double serial1, double serial2,
81  int first_day_of_week,
82  int first_day_of_year );
83 
84  int fb_hDateParse ( const char *text, size_t text_len,
85  int *pDay, int *pMonth, int *pYear,
86  size_t *pLength );
88  int *pDay, int *pMonth, int *pYear );
89 FBCALL void fb_hDateDecodeSerial( double serial,
90  int *pYear, int *pMonth, int *pDay );
91 
92  int fb_hTimeParse ( const char *text, size_t text_len,
93  int *pHour, int *pMinute, int *pSecond,
94  size_t *pLength );
96  int *pHour, int *pMinute, int *pSecond );
97 FBCALL void fb_hTimeDecodeSerial( double serial,
98  int *pHour, int *pMinute, int *pSecond,
99  int use_qb_hack );
100 
102  int *pDay, int *pMonth, int *pYear,
103  int *pHour, int *pMinute, int *pSecond,
104  int want_date, int want_time );
105 
106 FBCALL void fb_I18nSet ( int on_off );
107 FBCALL int fb_I18nGet ( void );
108 
109  int fb_hTimeLeap ( int year );
110  int fb_hGetDayOfYear ( double serial );
111  int fb_hGetDayOfYearEx ( int year, int month, int day );
112  int fb_hGetWeekOfYear ( int ref_year, double serial, int first_day_of_year, int first_day_of_week );
113  int fb_hGetWeeksOfYear ( int ref_year, int first_day_of_year, int first_day_of_week );
114  int fb_hTimeDaysInMonth ( int month, int year );
115  void fb_hNormalizeDate ( int *pDay, int *pMonth, int *pYear );
116  int fb_hTimeGetIntervalType ( FBSTRING *interval );
117 
118  const char * fb_IntlGet ( eFbIntlIndex index, int disallow_localized );
119  int fb_IntlGetDateFormat( char *buffer, size_t len, int disallow_localized );
120  int fb_IntlGetTimeFormat( char *buffer, size_t len, int disallow_localized );
121  FBSTRING * fb_IntlGetMonthName ( int month, int short_name, int disallow_localized );
122  FBSTRING * fb_IntlGetWeekdayName( int weekday, int short_names, int disallow_localized );
123 
124  const char * fb_DrvIntlGet ( eFbIntlIndex index );
125  int fb_DrvIntlGetDateFormat ( char *buffer, size_t len );
126  int fb_DrvIntlGetTimeFormat ( char *buffer, size_t len );
127  FBSTRING * fb_DrvIntlGetMonthName ( int month, int short_name );
128  FBSTRING * fb_DrvIntlGetWeekdayName( int weekday, int short_names );