Challenge!! Date to day converter!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 14

Challenge!! Date to day converter!!

Can you create a program that takes a date and outputs it's day? Example- input=01:04:2018 output=sunday. Share your creation.

1st Apr 2018, 2:54 PM
Rishu Kumar
Rishu Kumar - avatar
14 Answers
+ 2
###################### ######## ####### ######## ############ ######## ####### ############# ####### ######## ####### ###################### Here is my code.. CPP https://code.sololearn.com/cvJdSZ7i4Usa/?ref=app
5th Apr 2018, 4:01 PM
Saurav Priyadarshi
Saurav Priyadarshi - avatar
+ 18
Using Zeller's formula (for dates after September 14, 1752.): https://code.sololearn.com/chTE2gk5kbWW/?ref=app
5th Apr 2018, 9:14 AM
LukArToDo
LukArToDo - avatar
5th Apr 2018, 9:15 AM
LukArToDo
LukArToDo - avatar
+ 8
My solution. Enter date in the form: dd:mm:yyyy e.g: 1:4:2018 https://code.sololearn.com/caB1STt3SWuu/?ref=app
1st Apr 2018, 5:43 PM
ƒred
ƒred - avatar
+ 6
Check out my solution in cpp. It's very simple and easy to understand. I have used only if else and while loop to create it. It also works for a negative year that is an year in BC. My strategy was to save a date in the program and then count the number of days between the input date and fix date and then after dividing the no.of days with 7, the remainder will tell us the day of the date.☺️ https://code.sololearn.com/cLBWCIF8Ld86/?ref=app
3rd Apr 2018, 3:32 PM
Rishu Kumar
Rishu Kumar - avatar
+ 5
There it is, in Ruby. I used dd/mm/yyyy as date format. https://code.sololearn.com/cvu7W8A43yo9/?ref=app
1st Apr 2018, 5:05 PM
Paul
Paul - avatar
+ 5
You can submit this type of contents under lesson factory's assignment section.
4th Apr 2018, 12:43 PM
Aaron Sarkissian
Aaron Sarkissian - avatar
+ 4
My try. Kindly enter the date in the form of DD/MM/YYYY only. https://code.sololearn.com/cXrNu1Rs3kT3/?ref=app
2nd Apr 2018, 6:03 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
6th Apr 2018, 2:42 PM
Coder++
Coder++ - avatar
2nd Apr 2018, 8:09 AM
Mitali
Mitali - avatar
3rd Apr 2018, 8:32 PM
Coder++
Coder++ - avatar
+ 1
My try in Javascript. Please, someone could help me improve this code? insert the date on the format DD/MM/YYYY https://code.sololearn.com/WdKo1HfBAwkE
5th Apr 2018, 8:35 PM
Igor Figueiredo
Igor Figueiredo - avatar
0
Enter the date in yyyy-mm-dd format: https://code.sololearn.com/cdy8hp5L1562
7th Apr 2018, 1:10 PM
Mitali
Mitali - avatar
0
.v
10th Apr 2018, 11:42 AM
Bambang Rahmat
Bambang Rahmat - avatar