help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: how to get the first day in a month


From: Windhorn, Allen E [ACIM/LS/MKT]
Subject: RE: how to get the first day in a month
Date: Thu, 5 Jul 2018 13:29:38 +0000

On Wed, Jul 4, 2018 at 7:43 AM, shivax <address@hidden> wrote:

> I have a serial date
> I want to know the first day of the month of the serial date

Example:

>> datestr(737255)
ans = 14-Jul-2018  # Could just change the '14' to '01' here, but...
>> foo = datevec(737255)
foo =

   2018      7     14      0      0      0

>> foo(3) = 1   # This is easier
foo =

   2018      7      1      0      0      0

>> datenum(foo)
ans =  737242
>> datestr(foo)
ans = 01-Jul-2018
>> [N, S] = weekday(datenum(foo))
N =  1
S = Sun

Regards,
Allen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]