Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.NetStringToTimestamp ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> create function "pears"."NetStringToTimestamp"( in "sDateTime" char(25) ) returns timestamp begin set "sDateTime" = "trim"("sDateTime"); -- remove trailing and leading white space if "sDateTime" regexp '^\\d{4}\\-\\d{2}\\-\\d{2}(T|\\040)\\d{2}:\\d{2}($|Z$|\\+00:00$|:\\d{2}($|Z$|\\+00:00$))' then -- check to make sure it is formatted correctly set "sDateTime" = "REPLACE"("sDateTime",'T',' '); set "sDateTime" = "REPLACE"("sDateTime",'Z',''); set "sDateTime" = "REPLACE"("sDateTime",'+00:00',''); return convert(timestamp,"sDateTime",120) else return null end if end /* DOC 2018-08-03 ET create function which to change ISO string to timestamp. ISO string may include or not include seconds. */ </code> database/functions/pears_netstringtotimestamp.txt Last modified: 2026/08/07 19:24by 127.0.0.1