• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

What is the difference between DAY_OF_WEEK and DAY_OF_WEEK_IN_MONTH.?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 23928
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....

 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic