# Get DateTime Hour

GrammardateTime Hour
FlagsNative | Function

Get the hour in the current day of a DateTime. (0 is 12 AM)

# Arguments

  • datetime — DateTime

Returns — int

native int GetDateTimeHour(datetime dt);

Category: DateTime

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:2491

    // Automatic Variable Declarations
    // Variable Initialization
    lv_hour = GetDateTimeHour(lp_datetime);

    // Implementation

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:2508

    // Automatic Variable Declarations
    // Variable Initialization
    lv_hour = GetDateTimeHour(lp_datetime);

    // Implementation

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:2525

    // Automatic Variable Declarations
    // Variable Initialization
    lv_hour = GetDateTimeHour(lp_datetime);

    // Implementation

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:2543

    // Automatic Variable Declarations
    // Variable Initialization
    lv_hourIndex = GetDateTimeHour(lp_datetime);
    lv_displayHour = (ModI((lv_hourIndex - 1), 12) + 1);