Questions tagged as 'date'

3
answers

Run function in PHP to insert data into DB daily at specific time

I am creating a "module" of my system and now I have to create a function that, when it arrives at the time that is in the database, execute a insert . For example, if the table is the 22:00 time, at 10:00 pm every day it will run...
asked by 29.12.2015 / 01:14
3
answers

Calculate difference between two dates - I can not convert the date of the database to DateTime

Good afternoon! I made a function to calculate the difference of days between two dates, one of these dates is the current one (which I create using new DateTime() ) and the other one gets in the database and is saved as dateTime fore...
asked by 26.03.2017 / 19:38
2
answers

How to make a String presentable in this format yyyy-mm-dd HH: mm: ss.fff

I have a date that is a return of the database that comes in this format yyyy-mm-dd HH:mm:ss.fff , how can I turn it into dd-mm-yyyy HH:mm Example: My date is like this: 2015-01-16 07:49:45.0 and I want to leave it this wa...
asked by 05.06.2015 / 19:18
2
answers

Subtract dates in PHP [duplicate]

I'm having a project where I need to change information from week to week. Is there an automated PHP function that can help me subtract today's date by a base date I defined. For example: $datadehoje = (int)date("d/m/Y"); $database = (int...
asked by 04.08.2018 / 11:51
2
answers

SQL Left Join - smaller date greater than current date

3 tables: Processo , Evento , Alerta The goal is to make a query that returns all processes by adding the columns of the event type and date of the most recent event MAX(DataEvento) and the next alert (smaller date g...
asked by 25.05.2018 / 01:50
3
answers

How to convert Date to integer in java?

When I use this code: Date data = new Date(); SimpleDateFormat formatador = new SimpleDateFormat("dd/MM/yyyy"); int dataAtual = Integer.parseInt(formatador.format(data)); System.out.println(dataAtual); This error appears: E...
asked by 15.09.2017 / 21:20
2
answers

Enter a Date Range

Good morning, I'm doing a system that needs to record the presence of users in an event, separating by date and time period. The part of the period was simple, but the date I got a problem, I need to get the date of the form that inserts the Sta...
asked by 14.11.2016 / 14:14
1
answer

Return date with timezone from Brasilia

Does anyone know how I put the Brasilia time zone in this code? $file_path = "file.zip"; $file_update = date ("Y-d-m G:i:s", filemtime($file_path)); $date = date("n/j", filemtime($file_path)); $hours = date("H", filemtime($file_path)); $sec =...
asked by 02.10.2016 / 17:36
2
answers

Get current date / time AngularJS

I need to display on the page the current date followed by the current time, Here's what I've done so far, I just need to display the time if I continue as is, follow code: function dataHoje() { var data = new Date();...
asked by 15.04.2016 / 19:55
1
answer

CURRENT_TIMESTAMP () inserting zero

I am inserting more than 9000 records via query, but the CURRENT_TIMESTAMP () -3 is entering multiple fields with 0000-00-00 00:00:00. Is there any way to prevent this? INSERT INTO yourls.yourls_url (keyword, url, title, timestamp, ip, clicks)...
asked by 02.06.2015 / 02:30