digitalmars.D.learn - Day of week from date
- Joel (4/4) Sep 28 2017 With a given date, I want to know what day it is (like Sunday,
- rikki cattermole (2/7) Sep 28 2017 https://dlang.org/phobos/std_datetime_date.html#.DateTime.dayOfWeek
- Jonathan M Davis (9/16) Sep 28 2017 Date and SysTime also have that function. So, whether you're creating on...
- aberba (6/25) Sep 29 2017 The documentation of std.datetime is very confusing at first.
- Jonathan M Davis (11/40) Sep 29 2017 SysTime is not deprecated. If anything, it's the time point type that mo...
- Joel (1/1) Sep 28 2017 Thanks guys. :-D
With a given date, I want to know what day it is (like Sunday, Monday, etc). I had a look up on std.datetime, and core.time, but they don't seem to have a function for it.
Sep 28 2017
On 29/09/2017 4:25 AM, Joel wrote:With a given date, I want to know what day it is (like Sunday, Monday, etc). I had a look up on std.datetime, and core.time, but they don't seem to have a function for it.https://dlang.org/phobos/std_datetime_date.html#.DateTime.dayOfWeek
Sep 28 2017
On Friday, September 29, 2017 04:32:44 rikki cattermole via Digitalmars-d- learn wrote:On 29/09/2017 4:25 AM, Joel wrote:Date and SysTime also have that function. So, whether you're creating one of those types manually - e.g. Date(2012, 7, 19) - or getting it from the system clock - e.g. Clock.currTime() - dayOfWeek will give you the day of the week for that particular object. TimeOfDay is the only time point type in std.datetime that does not have dayOfWeek, but that's because it makes no sense given that it simply represents a time of day. - Jonathan M DavisWith a given date, I want to know what day it is (like Sunday, Monday, etc). I had a look up on std.datetime, and core.time, but they don't seem to have a function for it.https://dlang.org/phobos/std_datetime_date.html#.DateTime.dayOfWeek
Sep 28 2017
On Friday, 29 September 2017 at 03:42:18 UTC, Jonathan M Davis wrote:On Friday, September 29, 2017 04:32:44 rikki cattermole via Digitalmars-d- learn wrote:The documentation of std.datetime is very confusing at first. Monotime, Clock, DateTime, SysTime (deprecated?) ... can confuse you even though their names seems obvious when you're used to.... And then there's secs, mins, etc and those undocumented ones.On 29/09/2017 4:25 AM, Joel wrote:Date and SysTime also have that function. So, whether you're creating one of those types manually - e.g. Date(2012, 7, 19) - or getting it from the system clock - e.g. Clock.currTime() - dayOfWeek will give you the day of the week for that particular object. TimeOfDay is the only time point type in std.datetime that does not have dayOfWeek, but that's because it makes no sense given that it simply represents a time of day. - Jonathan M DavisWith a given date, I want to know what day it is (like Sunday, Monday, etc). I had a look up on std.datetime, and core.time, but they don't seem to have a function for it.https://dlang.org/phobos/std_datetime_date.html#.DateTime.dayOfWeek
Sep 29 2017
On Friday, September 29, 2017 14:34:04 aberba via Digitalmars-d-learn wrote:On Friday, 29 September 2017 at 03:42:18 UTC, Jonathan M Davis wrote:SysTime is not deprecated. If anything, it's the time point type that most code should be using. Now that std.datetime has been split into separate modules, it's in std.datetime.systime.On Friday, September 29, 2017 04:32:44 rikki cattermole via Digitalmars-d- learn wrote:The documentation of std.datetime is very confusing at first. Monotime, Clock, DateTime, SysTime (deprecated?)On 29/09/2017 4:25 AM, Joel wrote:Date and SysTime also have that function. So, whether you're creating one of those types manually - e.g. Date(2012, 7, 19) - or getting it from the system clock - e.g. Clock.currTime() - dayOfWeek will give you the day of the week for that particular object. TimeOfDay is the only time point type in std.datetime that does not have dayOfWeek, but that's because it makes no sense given that it simply represents a time of day. - Jonathan M DavisWith a given date, I want to know what day it is (like Sunday, Monday, etc). I had a look up on std.datetime, and core.time, but they don't seem to have a function for it.https://dlang.org/phobos/std_datetime_date.html#.DateTime.dayOfWeek... can confuse you even though their names seems obvious when you're used to....Well, I really don't know how to help you there. The documentation on the types and functions in there says what they do, and there are examples on most of the functions.And then there's secs, mins, etc and those undocumented ones.I'm not sure what you're talking about here. AFAIK, everything is documented. The only missing docs that I'm aware of are some examples that don't show up on some of the functions due to a compiler bug. - Jonathan M Davis
Sep 29 2017