---
name: "time_fields_from_filetime"
section: "3"
platform: "linux"
package: "libsynce0-dev"
version: "0.15-1.1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/time_fields_from_filetime"
---

# time\_fields\_from\_filetime(3)

convert between FILETIME and TIME\_FIELDS

## NAME

time\_fields\_from\_filetime - convert between FILETIME and TIME\_FIELDS

## SYNOPSIS

```
#include <synce.h>

void time_fields_from_filetime(const FILETIME *filetime, TIME_FIELDS *timeFields);

bool time_fields_to_filetime(const TIME_FIELDS *timeFields, const FILETIME *filetime);
```

## DESCRIPTION

The **time\_fields\_from\_filetime**() function converts a FILETIME value into the existing broken down TIME\_FIELDS struct pointed to by **timeFields**. **time\_fields\_to\_filetime**() does the reverse.

```
typedef struct _TIME_FIELDS {
    CSHORT Year;          /* Specifies a value from 1601 on. */
    CSHORT Month;         /* Specifies a value from 1 to 12. */
    CSHORT Day;           /* Specifies a value from 1 to 31. */
    CSHORT Hour;          /* Specifies a value from 0 to 23. */
    CSHORT Minute;        /* Specifies a value from 0 to 59. */
    CSHORT Second;        /* Specifies a value from 0 to 59. */
    CSHORT Milliseconds;  /* Specifies a value from 0 to 999. */
    CSHORT Weekday;       /* Specifies a value from 0 to 6 (Sunday to Saturday). */
} TIME_FIELDS;
```

## RETURN VALUE

The **time\_fields\_to\_filetime**() function returns FALSE on encountering an invalid value, or TRUE if successful.

## SEE ALSO

[**synce**(7)](/synce/7.md)
