java - Date text box should be always 1st date current month.? -


i want javascript or java program should give date 1st of current month. there tech?

you can use calendar java

      date date = new date(system.currenttimemillis());       cal = calendar.getinstance();       cal.settime(date);       cal.set(calendar.day_of_month, 1); 

now every want calendar object day of week (sat, sun, .... )

int weekday = cal.get(calendar.day_of_week); 

and javascript can use:

var thefirst = new date(); thefirst.setdate(1); 

setdate sets day of month date object (from 1 31). can whatever want thefirst, day of week.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -