<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">cd_convert wants a numeric input not character or string.&nbsp;<div class=""><br class=""></div><div class="">I’m now confused what the actual question is, but assuming that time0 = <span style="background-color: rgb(255, 255, 255);" class=""><font size="2" class="">"1978-04-13_18:00:00”&nbsp;</font></span></div><div class="">and that you for some reason want to offset it by 6 hours. &nbsp;</div><div class=""><br class=""></div><div class="">In the next release of NCL cd_inv_string() will be included. <a href="https://www.ncl.ucar.edu/Document/Functions/User_contributed/cd_inv_string.shtml" class="">https://www.ncl.ucar.edu/Document/Functions/User_contributed/cd_inv_string.shtml</a></div><div class="">I have attached my most recent version of it here.&nbsp;</div><div class="">Using that I would do the following, still not sure why though:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><font face="Monaco" class=""><br class=""></font></div><div class=""><font face="Monaco" class="">time_num = cd_inv_string(tostring(time0), "%Y-%N-%D_%H:%M:%S") &nbsp;;; &nbsp;will return a “hours since 1800-01-01” numeric</font></div><div class=""><font face="Monaco" class="">time_num = time_num - 6 &nbsp;;; offset by -6 hours for whatever reason.&nbsp;</font></div><div class=""><font face="Monaco" class="">;; This is now technically wrong though, depending on your application.&nbsp;</font></div><div class=""><font face="Monaco" class=""><br class=""></font></div><div class=""><font face="Monaco" class=""><br class=""></font></div><div class=""><font face="Monaco" class="">time_out = cd_string(time_num, "%Y-%N-%D_%H:%M:%S" )</font></div><div class=""><font face="Monaco" class=""><br class=""></font></div><div class=""><font face="Monaco" class="">print(time_out)</font></div><div class=""><font face="Monaco" class=""><br class=""></font></div><div class=""><font face="Monaco" class="">;;; assuming things are correct, &nbsp;!! &nbsp;unsure about this last line.&nbsp;</font></div><div class=""><font face="Monaco" class="">time0 = tochar(time_out) &nbsp; &nbsp;;; this may require some more finesse to handle dimensions&nbsp;</font></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""></div></body></html>