---
name: "StrFromTimeIntervalA"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/StrFromTimeIntervalA"
---

# StrFromTimeIntervalA(3w)

## NAME

**StrFromTimeIntervalA** (SHLWAPI.@)

## SYNOPSIS

INT StrFromTimeIntervalA\
  (\
   LPSTR *lpszStr*,\
   UINT  *cchMax*,\
   DWORD *dwMS*,\
   int   *iDigits*\
  )

## DESCRIPTION

Format a millisecond time interval into a string.

## PARAMS

*lpszStr* **\[Out\]**  Output buffer for formatted time interval.

*cchMax* **\[In\]**  Size of *lpszStr*.

*dwMS* **\[In\]**  Number of milliseconds.

*iDigits* **\[In\]**  Number of digits to print.

## RETURNS

The length of the formatted string, or **0** if any parameter is invalid.

## NOTES

This implementation mimics the Win32 behaviour of always writing a leading space before the time interval begins.

*iDigits* is used to provide approximate times if accuracy is not important. This number of digits will be written of the first non-zero time class (hours/minutes/seconds). If this does not complete the time classification, the remaining digits are changed to zeros (i.e. The time is \_not\_ rounded). If there are digits remaining following the writing of a time class, the next time class will be written.

For example, given *dwMS* represents **138** hours,43 minutes and **15** seconds, the following will result from the given values of iDigits: \
\
   iDigits    1        2        3        4               5               ...\
\
   lpszStr   "100 hr" "130 hr" "138 hr" "138 hr 40 min" "138 hr 43 min"  ...

## IMPLEMENTATION

Declared in **"shlwapi.h"**.

Implemented in **"dlls/shlwapi/string.c"**.

Debug channel **"shell"**.
