• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the difference between DAY_OF_WEEK and DAY_OF_WEEK_IN_MONTH.?  RSS feed

 
vicky ece
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between DAY_OF_WEEK and DAY_OF_WEEK_IN_MONTH.?why i am getting different output for the same date...



Output is : My Uncle BirthDay is going to be on the day :Monday



Output is : My Uncle BirthDay is going to be on the day :SUNDAY

Why the output varies and the actual date is SUNDAY.. Any idea....
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the Calendar API? If you're still not sure after reading that, come back and describe your confusion.
 
vicky ece
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greg Brannon wrote:Have you read the Calendar API? If you're still not sure after reading that, come back and describe your confusion.



Thanks for your quick reply i have read Calendar API it is confusing for me , so can you you explain me why i am getting different answer
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vicky ece wrote: What is the difference between DAY_OF_WEEK and DAY_OF_WEEK_IN_MONTH.?why i am getting different output for the same date...



Output is : My Uncle BirthDay is going to be on the day :Monday



Output is : My Uncle BirthDay is going to be on the day :SUNDAY

Why the output varies and the actual date is SUNDAY.. Any idea....



I believe you are confusing what DAY_OF_WEEK_IN_MONTH actually returns. It didn't return MONDAY. It returned the number 2. So, basically, your uncle's birthday is on a SUNDAY, specifically, the second SUNDAY of the month.

Henry
 
vicky ece
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
vicky ece wrote: What is the difference between DAY_OF_WEEK and DAY_OF_WEEK_IN_MONTH.?why i am getting different output for the same date...

So, basically, your uncle's birthday is on a SUNDAY, specifically, the second SUNDAY of the month.

Henry



Thank you sooooo much i got it....
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!