Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
date_time.c File Reference
Date and time management. More...
Go to the source code of this file.
Functions | |
| const char_t * | formatSystemTime (systime_t time, char_t *str) |
| Format system time. | |
| const char_t * | formatDate (const DateTime *date, char_t *str) |
| Format date. | |
| void | getCurrentDate (DateTime *date) |
| Get current date and time. | |
| time_t | getCurrentUnixTime (void) |
| Get current time. | |
| void | convertUnixTimeToDate (time_t t, DateTime *date) |
| Convert Unix timestamp to date. | |
| time_t | convertDateToUnixTime (const DateTime *date) |
| Convert date to Unix timestamp. | |
| uint8_t | computeDayOfWeek (uint16_t y, uint8_t m, uint8_t d) |
| Calculate day of week. | |
Detailed Description
Date and time management.
License
Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version:
- 1.7.6
Definition in file date_time.c.
Function Documentation
| uint8_t computeDayOfWeek | ( | uint16_t | y, |
| uint8_t | m, | ||
| uint8_t | d | ||
| ) |
Calculate day of week.
- Parameters:
-
[in] y Year [in] m Month of year (in range 1 to 12) [in] d Day of month (in range 1 to 31)
- Returns:
- Day of week (in range 1 to 7)
Definition at line 298 of file date_time.c.
| time_t convertDateToUnixTime | ( | const DateTime * | date ) |
Convert date to Unix timestamp.
- Parameters:
-
[in] date Pointer to a structure representing the date and time
- Returns:
- Unix timestamp
Definition at line 253 of file date_time.c.
| void convertUnixTimeToDate | ( | time_t | t, |
| DateTime * | date | ||
| ) |
Convert Unix timestamp to date.
- Parameters:
-
[in] t Unix timestamp [out] date Pointer to a structure representing the date and time
Definition at line 194 of file date_time.c.
| const char_t* formatDate | ( | const DateTime * | date, |
| char_t * | str | ||
| ) |
Format date.
- Parameters:
-
[in] date Pointer to a structure representing the date [out] str NULL-terminated string representing the specified date
- Returns:
- Pointer to the formatted string
Definition at line 130 of file date_time.c.
| const char_t* formatSystemTime | ( | systime_t | time, |
| char_t * | str | ||
| ) |
Format system time.
- Parameters:
-
[in] time System time [out] str NULL-terminated string representing the specified time
- Returns:
- Pointer to the formatted string
Definition at line 75 of file date_time.c.
| void getCurrentDate | ( | DateTime * | date ) |
Get current date and time.
- Parameters:
-
[out] date Pointer to a structure representing the date and time
Definition at line 161 of file date_time.c.
| time_t getCurrentUnixTime | ( | void | ) |
Generated on Tue Jul 12 2022 17:10:19 by
1.7.2