How do i get the fist day of every month in objective scripting

Answers

If you substract the current day-of-the month from the current date in $horolog format, you will end up with the first day of the current month in $horolog format :

Write $horolog - $zdate($horolog, 4) + 1

 

If your date is in another format, convert it using $zdateh/$zdate, see also :

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

and

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

If you meant that you want to get the day (name/value) from the date then try $zdate(datevalue,dayformat) where datevalue is in $h format and dayformat is 10 for number of day in week, 11 for short day name, 12 for full day name.

check out the docs about $zdate , $zdateh, $systm.sql.datepart for more info about working with dates.

Comments

What do you mean?
If you have month and year just add 01 and produce the date.