Questions tagged as 'datetime'

7
answers

How do I know if today's date is Saturday or Sunday (weekend) in PHP?

I want to know what is the simplest possible way to find out if today's date is Saturday or Sunday in PHP. What are the possible ways to do this?     
asked by 23.06.2016 / 19:55
2
answers

Is it possible to have month 13 on a date in Java?

I was looking at the documentation for class Formatter of Java 7, on this link of Oracle itself , when I noticed the following example below: What intrigued me was the example given for the month formatting option, m : which...
asked by 23.04.2015 / 21:08
5
answers

How to get TimeStamp in Javascript?

Would you like to know how to Javascript to get Timestamp ? A number that represents the current date and time. I know we get the object for date and time through: var d = new Date(); But I do not know how to proceed from here....
asked by 17.12.2013 / 17:39
2
answers

Definition of the day of the week in the GregorianCalendar

I have the following code which is responsible for creating a GregorianCalendar for handling a date. TimeZone tz = TimeZone.getTimeZone("America/Sao_Paulo"); TimeZone.setDefault(tz); Calendar calendar = GregorianCalendar.getInstance(tz); c...
asked by 11.12.2013 / 21:29
4
answers

How to use SimpleDateFormat in competing environments?

The class SimpleDateFormat is not thread safe . I recently had problems with instances of class SimpleDateFormat in static context being used by multiple threads concurrently in a web application. private static final DateForm...
asked by 11.12.2013 / 20:55
3
answers

How to create a DateTime object that represents the last day of a given month?

In an object of type DateTime , how do I get a new object object DateTime that represents the last day of the month of the first object? var data = new Date(2017, 3, 1); // 01/03/2017 var dataUltimoDia = ??? // 31/03/2017     
asked by 09.12.2015 / 16:54
5
answers

Difference between two dates in days, hours, minutes and seconds

Problem: How to perform the subtraction between two dates and return the value in Days, Hours, Minutes and Seconds in a SQL query with SQL Server 2014? Example: Dados: DataRecebimento DataEnvio 2013-11-29 11:30:40.157 2014-05-2...
asked by 11.07.2014 / 17:43
2
answers

Get the current date and time on the internet, in desktop application

I am implementing a system lock by date, and I need to get the current date of brasilia for example, which would be the official time in Brazil, or the date in time zone -3. I believe there are web services that do this and that are reliable,...
asked by 17.04.2014 / 22:13
3
answers

How to format a date in 'dd / MM / yyyy' format?

How to get a formatted string from an object of type Date in format dd/MM/yyyy ?     
asked by 18.02.2016 / 13:10
3
answers

Change TimeZone from DateTime.now

I am hosting my system on a server that is in the US Then using DateTime.Now returns the US date and time. I would like to return the date and time of Brazil. Is it possible?     
asked by 11.01.2015 / 14:07