language-extensions/R/src/Utilities.cpp
//--------------------------------------------------------------------------------------------------
// Name: Utilities::SetTimeZoneInR
//
// Description:
//  Sets the time zone in R to the given value or unset it if the value is empty.
//
// Returns:
//  Nothing.
//
:SetTimeZoneInR
Description:
Sets the time zone in R to the given value or unset it if the value is empty.

Nothing.
: SetTimeZoneInR Description : Sets the time zone in R to the given value or unset it if the value is empty . Nothing .
void Utilities::SetTimeZoneInR(string valueToSet)
{
	if (valueToSet.length() > 0)
	{
		ExecuteScript("Sys.setenv(TZ = '" + valueToSet + "')");
	}
	else
	{
		 If time zone was not set, unset it again.
		 On Windows, it default is UTC while on Linux it is the local time zone.
		ExecuteScript("Sys.unsetenv('TZ')");
	}
}
void Utilities :: SetTimeZoneInR ( string valueToSet ) { if ( valueToSet . length ( ) > 0 ) { ExecuteScript ( " " + valueToSet + " " ) ; } else { ExecuteScript ( " " ) ; } }
Name: Utilities::SetTimeZoneInR
Description:
Sets the time zone in R to the given value or unset it if the value is empty.
Name : Utilities :: SetTimeZoneInR Description : Sets the time zone in R to the given value or unset it if the value is empty .
// Reset the stored time zone using the temporary variable above. // // If time zone was not set, unset it again. // On Windows, it default is UTC while on Linux it is the local time zone. //