bugGNU Octave - Bugs: bug #54259, weekday function bug

 
 

bug #54259: weekday function bug

Submitter:  None
Submitted:  Fri 06 Jul 2018 04:21:00 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Srikanth Madala Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.1
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 06 Jul 2018 05:03:59 PM UTC, comment #4: 

Thank you for the quick response folks. I am importing data from Excel which treats date starting from 1900 AD I believe. Where as Octave seems to start it at 0000 AD. Hence, for the same date, the numbers are not the same and offset by 1900 years. So I added 693960 to the excel imported data, and it fixes the issue for me. Thank you again!

-Srikanth

Anonymous
Fri 06 Jul 2018 04:38:20 PM UTC, comment #3: 

Dmitri is correct.  Using datestr I find that the original number is a date back in the 2nd century C.E.


octave:1> datestr (43273)
ans = 23-Jun-0118


Closing report.

Rik <rik5>
Group administrator
Fri 06 Jul 2018 04:36:39 PM UTC, comment #2: 

There are a couple misunderstandings going on here, but this is not a bug.

If you have questions about how to use the date/time-related functions, please use the help mailing list (https://lists.gnu.org/mailman/listinfo/help-octave).

Mike Miller <mtmiller>
Group Member
Fri 06 Jul 2018 04:32:10 PM UTC, comment #1: 

Why do you think 6/22/2018 is the same as 43273 ?



datenum("6/22/2018")
ans =  737233
[n,s] = weekday(737233)
n =  6
s = Fri


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 06 Jul 2018 04:21:00 PM UTC, original submission:  

Dear Sir/Madam,

I am using the two following ways of executing weekday function and there seems to be an error when use the same date as a numerical value. Please kindly let me know how to fix this bug.

>> [n, s]=weekday(6/22/2018)

n =  6
s = Fri

>> [n, s]=weekday(43273)

n =  5
s = Thu

Thank you
Srikanth Madala

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-06 mtmiller StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code