Tags » Datetime

Mocking Django Timezone

I use django.utils.timezone.now() in a lot of my code. It returns the datetime in the timezone specified in settings.py. One side effect of using this function is that during testing, you may want “now()” to be a fixed date time. 127 more words


Various quarter-related DateTime functions in C#

The DateTime object – or struct – lacks functions for quarters. You can e.g. add minutes, months, days etc. to a date but not quarters. 118 more words


Data e Hora Crm 2011 JavaScript

Somar data e incluir no campo

var data = Xrm.Page.data.entity.attributes.get(“sof_data”).getValue(new Date());

var lembrete = Xrm.Page.getAttribute(“sof_lembrete”).getValue();

var dataWorflow = new Date().setDate(data.getDate()+lembrete);


Função para setar hora no campo… 38 more words

Sem Categoria

Truncate a DateTime in C#

Occasionally you need to truncate a date to the nearest year, month, day etc. E.g. you need to transform the date 2015-06-05 15:33:30 into 2015-06-05 00:00:00, i.e. 154 more words


SQL - Get Current Week Start & End Dates

Rather than using GETDATE(), you can use any other specific Date  to get its relevant week start and end dates.


DECLARE @DateFrom DATETIME… 39 more words


Simple Date Handling in Go

Package time provides functionality focused on managing times and dates. The package consists of a wide range of features designed to facilitate a Gregorian calendar. Here is a canonical example: 824 more words


Python Scripting : Get max Last Modified Date using os.walk

Below is the code that i have written to get the max Lsat Modified Date of the files in all folders that i can delete all the folders that are not not being used by me for a long time. 87 more words