1 | #ifndef AWS_COMMON_TIME_H |
2 | #define AWS_COMMON_TIME_H |
3 | /* |
4 | * Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | * |
6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | * You may not use this file except in compliance with the License. |
8 | * A copy of the License is located at |
9 | * |
10 | * http://aws.amazon.com/apache2.0 |
11 | * |
12 | * or in the "license" file accompanying this file. This file is distributed |
13 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
14 | * express or implied. See the License for the specific language governing |
15 | * permissions and limitations under the License. |
16 | */ |
17 | #include <aws/common/common.h> |
18 | |
19 | #include <time.h> |
20 | |
21 | AWS_EXTERN_C_BEGIN |
22 | |
23 | /** |
24 | * Cross platform friendly version of timegm |
25 | */ |
26 | AWS_COMMON_API time_t aws_timegm(struct tm *const t); |
27 | |
28 | /** |
29 | * Cross platform friendly version of localtime_r |
30 | */ |
31 | AWS_COMMON_API void aws_localtime(time_t time, struct tm *t); |
32 | |
33 | /** |
34 | * Cross platform friendly version of gmtime_r |
35 | */ |
36 | AWS_COMMON_API void aws_gmtime(time_t time, struct tm *t); |
37 | |
38 | AWS_EXTERN_C_END |
39 | |
40 | #endif /* AWS_COMMON_TIME_H */ |
41 | |