Skip to main content

system.kanoa.utilities.convertDatesToString

This function requires KanoaCore module

Description

Converts a list of dates to strings, adjusted to the SQL Server's timezone, for passing to a stored procedure in KanoaCore.

Syntax

convertDatesToString(datesIn, deviceUTCOffsetMins)
  • Parameters
      list datesIn - List of dates to be converted [startDate, endDate].
      int deviceUTCOffsetMins - Offset in minutes for the device's timezone.
  • Returns
      list datesOut - List of converted date strings.
  • ### Code Examples
    # Usage example
    converted_dates = system.kanoa.utilities.convertDatesToString(datesIn=['2024-01-01 10:00:00', '2024-01-01 12:00:00'], deviceUTCOffsetMins=300)

    if converted_dates is not None:
    print(f"Converted dates: {converted_dates}")
    else:
    print("Conversion failed.")