[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM
From: |
Nick Jankowski |
Subject: |
[Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM |
Date: |
Sun, 11 Oct 2015 12:56:01 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0 |
Follow-up Comment #5, bug #46171 (project octave):
ok, replacing the lines 254-263 if block with:
if (! isempty (idx))
## Kludge to handle FFF millisecond format since strptime does not
msec = ds(idx+1:idx+3) #only works for 3digits in data, will fail for <3
f(idx:idx+2) = msec#[];
[~, nc] = strptime (ds, f);
if (nc > 0)
#msec = ds(nc:min(nc+2, end));
#f = [f(1:idx-1) msec f(idx:end)];
[tm, nc] = strptime (ds, f);
tm.usec = 1000 * str2double (msec);
endif
makes things work for having both FFF and am/pm. I left the commented out
lines in the inner if block for reference. also, note that it will only work
for 3 digits given for the FFF part. If less than three digits is given for
FFF, it will grab extra trailing characters. previous code assumed the FFF
data was either 3 digits or at the end of the string. not sure of the best way
to cover that. if there's an easy way to have it grab up to the first
non-numeric or whitespace, then the line I threw into Comment 2 could take
care of it for numel(msec)<3
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?46171>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM, Nick Jankowski, 2015/10/10
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM, Nick Jankowski, 2015/10/10
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM, Nick Jankowski, 2015/10/11
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM, Nick Jankowski, 2015/10/10
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM, Nick Jankowski, 2015/10/11
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM,
Nick Jankowski <=
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM, Nick Jankowski, 2015/10/11
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM, Nick Jankowski, 2015/10/11
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM, Nick Jankowski, 2015/10/13
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM, Rik, 2015/10/22
- [Octave-bug-tracker] [bug #46171] datevec fails with FFF and PM, Nick Jankowski, 2015/10/22