A DateTime object in many programming languages describes a date and a time of day. It can express either an instant in time or a position on a calendar, depending on the context in which it is used and the specific implementation. This tag can be used for all date and time related issues.
0
votes
3answers
34 views
Convert this.tb.Text = DateTime
Maybe a dumb question, but why does this not work?
Convert.ToDateTime(this.tb_start_date.Text) = DateTime.Now.AddDays(-90)
I know you can't just = a string to a DateTime, but I thought having the ...
0
votes
3answers
20 views
SQL Server 2008 - Display time difference
I have SQL Server 2008 query that displays Start_of_Attack and End_of_Attack:
SELECT
CAST (DATEADD(SECOND, dbo.AGENT_SECURITY_LOG_1.BEGIN_TIME /1000 + 8*60*60, '19700101') AS VARCHAR(50)) as ...
0
votes
2answers
15 views
Changing date format stored as a String
Currently I store a date in my database in the following format
dbTimestamp = new SimpleDateFormat("yyyy-MM-dd").format(myCalendar.getTime());
I am looking to pull this information in a cursor and ...
-2
votes
1answer
37 views
IComparable sorting with DateTime
I had a similar question answered earlier, then my boss told me to sort it based on date so here I am again.
I have this -
List<User> users;
protected class User : ...
0
votes
2answers
15 views
Create Active Model datetime with Epoch Timestamps
I have a mobile application that can create events by sending a Post request to our Rails application using the standard routing for a SimpleEvent model. The important pieces of the model look like so ...
0
votes
1answer
7 views
Interpolate / Extend quarterly to monthly series
I have a data.frame that contains quarterly observations. I now want to interpolate monthly values (preferred cubic, linear is fine). The intermediate goal should be to create a data.frame with DATE ...
0
votes
2answers
34 views
Some problems using ToShortDateString() method on a nullable DateTime object, why?
I have the following problem.
In a class I declare:
vulnerabilityDetailsTable.AddCell(new PdfPCell(new Phrase(currentVuln.Published.ToString(), _fontNormale)) { Border = PdfPCell.NO_BORDER, Padding ...
0
votes
1answer
14 views
Laravel : display personal format of timestamps fields
In my project I used this code to format timestamps fields
date('D m Y H:i', strtotime($post->created_at))
But as I have many places and fields to display it's a bit boring, and if I need to ...
0
votes
1answer
14 views
date_create_from_format php on certain month and date does not return correct date
I have a function in php that uses the date_create_from_format function to convert dates in format 'Ym' to datetime. It works correctly except in one case I found today and I cant find the problem. ...
1
vote
1answer
20 views
Pandas Multiindex not working with read_csv and datetime objects
I have a problem loading a dataframe from csv when I have a multiindex with more than one date in it.
I am running the following code:
import pandas as pd
import datetime
date1 = ...
3
votes
1answer
39 views
convert time in Python
I am parsing an xml file in python and I need to convert the following date and time format to something human-friendly:
<due_date>735444</due_date>
...
0
votes
1answer
29 views
How can i Compare dates in php with different formats Y/m/d and Y/m/d H:M stored in a database?
I have a query like that:
$monitor = $db->query("SELECT * FROM event, step WHERE step = idstep ");
$countquery = $monitor->rowCount();
if ($countquery == 0){
echo "no records";
}else{
...
2
votes
1answer
30 views
use DateTime or String in .net Web Service method sigs
which datatype is best to use for passing dates around my organisation from .net web services?
I am inclined to expose the services using DateTime fields - this means any client code (java, C# etc) ...
0
votes
1answer
24 views
Matlab timestamp conversion
I would like to alter the format of some time-stamps
I have obtain them in this form
2.010010101000000e+07
I would like to convert them into the form
7.341390416666666e+05
The target is using ...
0
votes
1answer
13 views
how to get all timezone names in ICU
I am using boost::locale with ICU Backend to do time conversion between different timezones.when creating boost::local::Calendar, I can pass in a string like "America/New_York" to specify the timezone ...
1
vote
0answers
23 views
d3.js - display time on xAxis
I'm doing something like this. I adopted this example.
But I want to have an x-axis that shows dates, not just some numbers as in the example. Here is the important part of my code: but it is not ...
0
votes
1answer
18 views
PowerShell date format not accepted in SQL
I'm having kind of a strange problem. When the server's Region and Language settings is set to English (United States) there are no issues with objects containing the date and time. But when I change ...
7
votes
1answer
110 views
first day != “first day of this month”
There's a really strange behaviour in PHP when using "first day" to modify a date.
'first day' ' of'? Sets the day of the first of the current month. ...
0
votes
2answers
34 views
Order a list of objects by it's DateTime property
Imagine following class:
Class Person {
DateTime birthdate;
}
I do have a list with some Person-objects:
List<Person> persons;
This list has already been through some special sorts, ...
0
votes
2answers
34 views
Ruby:Change UTC time zone to UTC+ or UTC - zone
I want to convert the utc time to 'utc+1' or 'utc+something' time zone and convert back that to utc time zone.
Its something like that what i want to do. I am asking user to choose there UTC time ...
0
votes
0answers
2 views
Date Difference format in 'PnYnMnDTnHnMnS'
I want to find difference of two dates in Java that should return result in this PnYnMnDTnHnMnS format.
For example:
Date1: 2014-05-28
Date2: 2014-06-30
The result should be: P1M2D
How do I do that?
...
2
votes
3answers
44 views
Compare two dates with time whose Formate is yyyy-MM-dd HH:mm:ss in Android
I have to compare two dates whose format is yyyy-MM-dd HH:mm:ss. I know the way to compare date only the before or after date function.
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd ...
0
votes
7answers
55 views
How can I display time in AM/PM format
I wanted to display time in AM / PM format.
Example : 9:00 AM
I wanted to perform addition subtraction operation as well. My event will start from 9:00 AM all time. I wanted to add minutes to get ...
0
votes
1answer
13 views
Calculating duration using date/timestamps in XSLT 2.0?
I'm using XSLT 2.0, and am trying to calculate the in WS-Trust messages, where there're and elements, so I need to determine the number of days, fractionally, between two date/timestamps, e.g., ...
0
votes
1answer
39 views
Merge yyyymmdd, hhmmss and sss columns to datetime
Table IFCD structure as follow:
tdate ttime updatemillisec
20140730 093014 500
...
How to merge columns to one column which names tdatetime, as yyyy-mm-dd hh:mm:ss.mmm format?
My ...
0
votes
1answer
24 views
Converting a date/time string to a date object
I have a string:
"2014-07-30T21:11:35.6300000"
but when I do
new Date(str)
It computes:
Wed Jul 30 2014 17:11:35 GMT-0400 (Eastern Daylight Time)
Q: How do I tell JavaScript not to ...
0
votes
2answers
13 views
Wrong results from DateTime::createFromFormat
I receive a string representing a date in the format YmdHis. When I turn it into a DateTime object and print it back out I get the timestamp for "now". Why is this happening?
$time = ...
0
votes
2answers
36 views
Determine most recent and next Payday (alternating Fridays)
I am very close to getting this to work and hope someone here can help push the ball over the top of the hill. In C#, I need to get the most recent Payday and the next Payday from today's date (and ...
-1
votes
0answers
13 views
Converting database UTC time to user's time [on hold]
Currently I pull information from a database and then display that information onto a website.
The date from the database is a PHP DateTime object.
What I want to do is
Get time from the DB
Get ...
1
vote
0answers
12 views
Bookshelf.js/Knex.js is too “helpful” with UTC DATETIME columns
I have a MySQL table, and this table has a DATETIME column named datetime_utc. It is, as you might expect, a date and time in UTC. In my Bookshelf models, I have defined a virtual getter that converts ...
2
votes
2answers
33 views
Dateutil's parser on February not parsing
I am getting a very strange bug in python.
from dateutil import parser
string = "March 2008"
parser.parse(string)
datetime.datetime(2008, 3, 30, 0, 0)
string = "February 2008"
parser.parse(string)
...
0
votes
0answers
6 views
NancyFX not serializing dates with a trailing Z to indicate UTC/Zulu
We store all of our dates in our database as UTC.
When they are returned to us from the API, they are in the following format
"createdDate":"2014-07-30T18:34:45"
But as you can see, the date ...
0
votes
0answers
9 views
get DatePeriod between DateTime_start & Datetime_End for Friday each (1 week, 2 week, 3 week, etc)
Any idea for solve this problem?
I have the next scheme in my database
Table: Event
**ID - Name - Date - start_time - end_time - recurring**
1 Event1 2014-07-28 ...
2
votes
1answer
32 views
Date Time Format Conversion
I have a list of these;
datetime.datetime(2011, 1, 31, 19, 30)
I wish to create a list of these;
2011-01-31 17:30:00
How is this done in a loop?
0
votes
1answer
26 views
Hours difference between time in sql server
I am trying to get the hours between the two dates using DATEDIFF(HOUR, FromTime, ToTime) but when the time is 00:00:00. And the I got the negative and wrong hours.
Code Below:
select FromTime, ...
1
vote
2answers
42 views
How to standardize datetime format for all regions?
Within my program i insert into the sql server the current time into a sql DateTime column.
Because the program is used by users around the world , i found out that some american users are receiving ...
1
vote
1answer
33 views
SQL - Changing column types from text to date and time
I have a table that contains two columns that I'd like to change their data type. Both are currently just declared as text but I'd like to change DateSent to a date and TimeSent to a time. The data is ...
1
vote
1answer
20 views
DateTime object returning NULL without var_dump
I'm having some weird problems with a DateTime() class.
Everytime I try this:
$object = new DateTime();
var_dump($object->date);
The var_dump() returns me NULL, but if I do this:
$object = new ...
0
votes
0answers
10 views
Text format value for SharePoint Date and Time column
I've got a Date and Time column in SharePoint and I try to assign value to it using SOAP API. However column is not updated and shows default value.
Assuming that I have no problems with other column ...
1
vote
2answers
26 views
rounding up time in python error
I get the following error when trying to round up time,
AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'
fajr_jamaat1 printout is 1900-01-01 04:25:00
Please help?
...
0
votes
2answers
39 views
Converting excel time to R time format
When I am trying to convert csv time format into R time format using the below code, I get datetime format although i do not intend to do so.
Why and how can i avoid it?
...
0
votes
4answers
23 views
Filter datetime in SQL Server
I know it is a stupid question but I can't get any idea even I asked Google.
Here's my scenario:
I have a table in my database named Sales with a column named dateTime.
The dateTime format is like ...
0
votes
2answers
27 views
Issue when converting or casting Date String to DateTime
I am using jQuery DatePicker to retrieve date for a textbox in Gridview for inserting/updating records. The datepicker's date is received as a String. e.g. value "07/31/2014".
Using following code I ...
0
votes
1answer
10 views
Custom Formatting of Grouping header having the data of type DateTime
I am using This Demo to create drag and drop grouping for jqGrid
I have a DateTime as a grouped column.
The formater for the column is
sorttype: 'date', formatter: 'date', formatoptions: { ...
-1
votes
0answers
30 views
Combine a date and timedelta to create a datetime
Given I have a date object and a timedelta object, is there a cleaner way of getting a datetime object then:
datetime.combine(my_date, time()) + my_timedelta
0
votes
1answer
11 views
Only some timezones working in datetime module for python
I'm trying to convert a time (including timezone) to just a time with everything in UTC. When i have the timezone GMT it works fine, but soon as i use PDT or PST i get an error.
Am i going about this ...
0
votes
1answer
32 views
Calculating Time Difference in R using lubridate
After converting factors in POSIXCT format and then applying datetime format, I want to take the difference of datetime between 2 pos1 and pos2.
However, when I do that for a specific item I get the ...
0
votes
0answers
16 views
How to fake JavaScript time and timezone in Cucumber tests?
In a Rails app, I am trying to write a Cucumber test for a page that displays an event's start time. The time is stored as UTC in the database, while an event.js script that runs on the page computes ...
-2
votes
0answers
27 views
Sql server query to calculate past and future date without weekends
Hi I want to combine these following two queries into one if possible, I want to calculate a past date or future date from a set date with a x amount of days and excluding weekends. the queries I'm ...
-2
votes
1answer
31 views
DATETIME Variable not inserting values properly
I need to copy some fields of a MS Project file into an Access table. I make it automatically through VBA.
The problem is that sometimes, Access picks dates wrong: takes date like mm/dd/aa instead of ...