Questions tagged as 'datetime'

2
answers

Should I use a DateTime or TimeStamp type field in mySQL?

I must save dates and times in different tables of a typical transactional application where I will store varied information, such as: Dates and times at which each transaction occurs (Invoice, Payment Receipt, etc.) Dates and times of fut...
asked by 02.11.2015 / 16:27
3
answers

Subtract two dates in c #

How can I subtract two dates in C #? I have two DateTime variables and I wanted to return the result in hours of them. DateTime fecharegistro = {04/05/2018 8:34:01} //obtenemos este valor de una bbdd DateTime fechafin = DateTime.Now.Substra...
asked by 07.05.2018 / 16:06
3
answers

Problem of Types DateTime C # + sqlserver

Good morning, I have the following problem. In a sqlserver database, I have an entity with datetime fields, I generated 2 new date fields and updated my model from the database. The fields were imported without problems, I add them to the corres...
asked by 05.06.2017 / 19:50
2
answers

Problem when defining time zone using tzinfo on datetime using pytz.timezone ()

I found the following problem when creating an object of type datetime with the constructor parameter tzinfo that defines the time zone. To define a time zone I used the pytz module as follows: import pytz as tz import dat...
asked by 09.08.2017 / 23:02
2
answers

DATE () vs DATE_FORMAT () in MySQL

The doubt came to me by answering a question here on Stackoverflow. The aim was to obtain only the date (without the time) of a column DATETIME , to compare it using BETWEEN . Obtaining that date can be done: Using DATE...
asked by 25.10.2017 / 12:49
3
answers

How to convert varchar to datetime in SQL Server?

Good day to all, I want to convert this data 14 de Febrero 1986 in sql to datetime , but%% of% CONVERT(datetime,fecha_nacimiento) It does not convert it. Is there any way to convert it?     
asked by 02.05.2018 / 16:43
1
answer

Insert a date before the scheduled date

I have a table called deliveries, within it 2 fields fecha_preparar and fecha_entrega . $fecha_prepararse = fecha_entrega - 4 dias INSERT INTO entregas (fecha_entrega, fecha_preparar) VALUES ('$fecha_entrega', '$fecha_prepararse'...
asked by 02.09.2017 / 07:01
1
answer

datetime.strptime returns 'NoneType' objects

I am trying to write a simple module to store date data from the information entered by the user: import datetime formato_dia = ("%Y%m%d","%Y/%m/%d", "%Y-%m-%d") def dia_manual(): while True: entrada_dia = input("""Escriba la fec...
asked by 06.08.2018 / 14:45
1
answer

Mysql get the next Monday at noon

Hello friends, could you help me with the following: I have a field with a timestamp format and I would like to know how to get the next Monday at midday to save it in date_end . journay date_start date_end 1 1515200400 1...
asked by 24.01.2018 / 02:57
1
answer

in PHP get the 25th day of the previous month

Month I would like to be able to select in my query the 25th day of the month before the present, regardless of whether we are at 2 or 27 in the current month, for example something like: Today's day 07/27/2018 <?=$date; ?> Result o...
asked by 27.07.2018 / 23:55