---
name: "libkydate"
section: "3"
platform: "linux"
package: "libkysdk-system"
version: "3.0.1.4-1"
release: "Arch Linux 2026-11-07"
platforms: ["linux"]
url: "https://carta.tech/man/libkydate"
---

# libkydate(3)

日期和时间格式信息

## NAME

kdk\_system\_get\_dateformat, kdk\_system\_set\_dateformat, kdk\_system\_set\_24\_timeformat, kdk\_system\_set\_12\_timeformat, kdk\_system\_get\_now\_dateformat,kdk\_system\_get\_now\_timeformat,  kdk\_system\_tran\_dateformat,kdk\_system\_nowtime,kdk\_system\_nowdate,kdk\_system\_shortweek, kdk\_system\_longweek,kdk\_system\_second,kdk\_system\_logn\_dateinfo,kdk\_system\_gjx\_time, kdk\_date\_freeall,kdk\_free\_dateinfo,kdk\_free\_logn\_dateinfo,kdk\_system\_set\_long\_dateformat, kdk\_system\_set\_short\_dateformat,kdk\_system\_get\_longformat\_date,kdk\_system\_get\_shortformat\_date, kdk\_system\_get\_longformat,kdk\_system\_get\_shortformat,kdk\_system\_longformat\_transform, kdk\_system\_shortformat\_transform,kdk\_system\_login\_lock\_dateinfo,kdk\_system\_timeformat\_transform, kdk\_free\_timeinfo - 日期和时间格式信息

## SYNOPSIS

```
#include <libkydate.h>

extern char** kdk_system_get_dateformat();

extern int kdk_system_set_dateformat(char *date);

extern int kdk_system_set_24_timeformat();

extern int kdk_system_set_12_timeformat();

extern char* kdk_system_get_now_dateformat();

extern char* kdk_system_get_now_timeformat();

extern kdk_dateinfo *kdk_system_tran_dateformat(struct tm *ptr);

extern char* kdk_system_nowtime();

extern char* kdk_system_nowdate();

extern char* kdk_system_shortweek();

extern char* kdk_system_longweek();

extern char* kdk_system_second();

extern kdk_logn_dateinfo *kdk_system_logn_dateinfo(char *user);

extern char* kdk_system_gjx_time(char *date);

extern inline void kdk_date_freeall(char **ptr);

extern void kdk_free_dateinfo(kdk_dateinfo *date);

extern void kdk_free_logn_dateinfo(kdk_logn_dateinfo *date);

extern int kdk_system_set_long_dateformat(char *format);

extern int kdk_system_set_short_dateformat(char *format);

extern char* kdk_system_get_longformat_date();

extern char* kdk_system_get_shortformat_date();

extern char* kdk_system_get_longformat();

extern char* kdk_system_get_shortformat();

extern char* kdk_system_longformat_transform(struct tm *ptr);

extern char* kdk_system_shortformat_transform(struct tm *ptr);

extern kdk_logn_dateinfo *kdk_system_login_lock_dateinfo(char *user);

extern kdk_timeinfo *kdk_system_timeformat_transform(struct tm *ptr);

extern void kdk_free_timeinfo(kdk_timeinfo *time);
Link with -lkydate.
```

## DATA STRUCTURES

Structure **kdk\_dateinfo** contains information related to a date:

**typedef struct \_kdk\_dateinfo{ {**\
\
 	**char \*date;     // 日期**\
     **char \*time;   // 时间**\
     **char \*timesec;  //带秒钟数时间**\
 **}kdk\_dateinfo;**

There are other members not documented here, which are only meant for libkydate internal use.

Structure **kdk\_logn\_dateinfo** contains information related to a login date:

**typedef struct \_kdk\_logn\_dateinfo {**\
\
 	**char \*date;     // 日期**\
     **char \*time;   // 时间**\
     **char \*week;**\
 **}kdk\_logn\_dateinfo;**

There are other members not documented here, which are only meant for libkydate internal use.

Structure **kdk\_timeinfo** contains information related to a time:

**typedef struct \_kdk\_timeinfo {**\
\
 	**char \*time;   // 时间**\
     **char \*timesec;  //带秒钟数时间**\
 **}kdk\_timeinfo;**

There are other members not documented here, which are only meant for libkynetinfo internal use.

## Detailed Description

This library obtains or sets date and time formats.

## RETURN VALUE

The return value is generally specific to the individual function called.

## CONFORMING TO

These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: **kdk\_system\_get\_dateformat**(), **kdk\_system\_set\_dateformat**(), **kdk\_system\_set\_24\_timeformat**(), **kdk\_system\_set\_12\_timeformat**(), **kdk\_system\_get\_now\_dateformat**(), **kdk\_system\_get\_now\_timeformat**(), **kdk\_system\_tran\_dateformat**(), **kdk\_system\_nowtime**(), **kdk\_system\_nowdate**(), **kdk\_system\_shortweek**(), **kdk\_system\_longweek**(), **kdk\_system\_second**(), **kdk\_system\_logn\_dateinfo**(), **kdk\_system\_gjx\_time**(), **kdk\_date\_freeall**(), **kdk\_free\_dateinfo**(), **kdk\_free\_logn\_dateinfo**(), **kdk\_system\_set\_long\_dateformat**(), **kdk\_system\_set\_short\_dateformat**(), **kdk\_system\_get\_longformat\_date**(), **kdk\_system\_get\_shortformat\_date**(), **kdk\_system\_get\_longformat**(), **kdk\_system\_get\_shortformat**(), **kdk\_system\_longformat\_transform**(), **kdk\_system\_shortformat\_transform**(), **kdk\_system\_login\_lock\_dateinfo**(), **kdk\_system\_timeformat\_transform**() and **kdk\_free\_timeinfo**().

## SEE ALSO

[**kdk\_system\_get\_dateformat**(3)](/man/kdk_system_get_dateformat/3.md), [**kdk\_system\_set\_dateformat**(3)](/man/kdk_system_set_dateformat/3.md), [**kdk\_system\_set\_24\_timeformat**(3)](/man/kdk_system_set_24_timeformat/3.md), [**kdk\_system\_set\_12\_timeformat**(3)](/man/kdk_system_set_12_timeformat/3.md), [**kdk\_system\_get\_now\_dateformat**(3)](/man/kdk_system_get_now_dateformat/3.md), **kdk\_system\_get\_now\_timeformat**(3), [**kdk\_system\_tran\_dateformat**(3)](/man/kdk_system_tran_dateformat/3.md), [**kdk\_system\_nowtime**(3)](/man/kdk_system_nowtime/3.md), [**kdk\_system\_nowdate**(3)](/man/kdk_system_nowdate/3.md), [**kdk\_system\_shortweek**(3)](/man/kdk_system_shortweek/3.md), [**kdk\_system\_longweek**(3)](/man/kdk_system_longweek/3.md), [**kdk\_system\_second**(3)](/man/kdk_system_second/3.md), [**kdk\_system\_logn\_dateinfo**(3)](/man/kdk_system_logn_dateinfo/3.md), [**kdk\_system\_gjx\_time**(3)](/man/kdk_system_gjx_time/3.md), [**kdk\_date\_freeall**(3)](/man/kdk_date_freeall/3.md), [**kdk\_free\_dateinfo**(3)](/man/kdk_free_dateinfo/3.md), [**kdk\_free\_logn\_dateinfo**(3)](/man/kdk_free_logn_dateinfo/3.md), [**kdk\_system\_set\_long\_dateformat**(3)](/man/kdk_system_set_long_dateformat/3.md), [**kdk\_system\_set\_short\_dateformat**(3)](/man/kdk_system_set_short_dateformat/3.md), [**kdk\_system\_get\_longformat\_date**(3)](/man/kdk_system_get_longformat_date/3.md), [**kdk\_system\_get\_shortformat\_date**(3)](/man/kdk_system_get_shortformat_date/3.md), [**kdk\_system\_get\_longformat**(3)](/man/kdk_system_get_longformat/3.md), [**kdk\_system\_get\_shortformat**(3)](/man/kdk_system_get_shortformat/3.md), [**kdk\_system\_longformat\_transform**(3)](/man/kdk_system_longformat_transform/3.md), **kdk\_system\_shortformat\_transform**(3), [**kdk\_system\_login\_lock\_dateinfo**(3)](/man/kdk_system_login_lock_dateinfo/3.md), [**kdk\_system\_timeformat\_transform**(3)](/man/kdk_system_timeformat_transform/3.md) and [**kdk\_free\_timeinfo**(3)](/man/kdk_free_timeinfo/3.md).
