convert_timezone() function to change datetime fields from one locale to another
on 09-17-201403:13 PM - last edited on 10-10-201509:46 PM by LainieH
SAS sorely needs a function that will allow you to convert a datetime stored in a specific local such as GMT to another such as PST. Many other languages already offer this type of function. In mySQL you can do this using syntax along the lines of:
Currently many SAS users are having to do this manually using the intnx() functions and manual date/time calculations, which can become very complex and has a high chance for mistakes due to things such as daylight savings, observance dates, state, etc...
You can see how badly this function is needed just by searching for 'sas convert timezone' and seeing how many people are out there asking for it. It is likely to become even more desired as there is an increasing trend for DBs to store everything in GMT and then allow the user to specify their locale so that dates/times will be displayed according to their own preferences. This makes it more difficult for those SAS analysts who need to work off the underlying unconverted data.