The 1C:Enterprise developers forum
Hi everyone,I have to get date of x week later from selected date on that year. I mean f.e I select today as begining day and I want to get all date of 3 weeks on period in this year (f.e 2015). How can I do that* Could you help me pelase?
Hello, Mehmet Tuğrul SARIÇİÇEK.You can add 7*24*60*60 to the date to get 1 week added to that date.
Thank you Timofey Bugaevsky, I got it, and How can I get last day of this year?
You can use EndOfYear() function for that.
I have a procedure "GetNewDay" so I can get any day I want back or ahead.
Function GetNewDay(InitialDate, NumberDays) Export Query = New Query; Query.SetParameter("InitialDate", InitialDate); Query.SetParameter("NumberDays", NumberDays); Query.Text = "Select | DateAdd(&InitialDate, Day, &NumberDays) AS Day"; Return Query.Execute().Unload()[0].Day; EndFunction DueDate = GetNewDay(InvoiceDate, +15); or ThreeDaysBefore = GetNewDay(InvoiceDate, -3);