• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 23949
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....

 
What? What, what, what? What what tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic