# Convert String To DateTime

Grammar — DateTime(string)
FlagsNative | Function

Converts a colon delimited string of numbers to a DateTime. Returns Jan 1, 1970 for an invalid string.

# Arguments

  • string — String

Returns — datetime

native datetime StringToDateTime(string inString);

Category: DateTime

# Examples

mods/liberty.sc2modbase.sc2data/TriggerLibs/LibertyLib.galaxy:961

    for ( ; auto0F553801_i <= UserDataInstanceCount(auto0F553801_userType) ; auto0F553801_i += 1 ) {
        lv_itInstance = UserDataInstance(auto0F553801_userType, auto0F553801_i);
        lv_itStart = StringToDateTime(UserDataGetString(libLbty_gv_starCraftEventsEventTable, lv_itInstance, "Start", 1));
        lv_itEnd = StringToDateTime(UserDataGetString(libLbty_gv_starCraftEventsEventTable, lv_itInstance, "End", 1));
        lv_itDisabler = UserDataGetGameLink("SCEvent_Events", lv_itInstance, "Disabler", 1);

mods/liberty.sc2modbase.sc2data/TriggerLibs/LibertyLib.galaxy:962

        lv_itInstance = UserDataInstance(auto0F553801_userType, auto0F553801_i);
        lv_itStart = StringToDateTime(UserDataGetString(libLbty_gv_starCraftEventsEventTable, lv_itInstance, "Start", 1));
        lv_itEnd = StringToDateTime(UserDataGetString(libLbty_gv_starCraftEventsEventTable, lv_itInstance, "End", 1));
        lv_itDisabler = UserDataGetGameLink("SCEvent_Events", lv_itInstance, "Disabler", 1);
        lv_itSkin = UserDataGetGameLink("SCEvent_Events", lv_itInstance, "Skin", 1);