Questions tagged [datetime-format]

1

votes
2

answer
1.2k

Views

Java Current Date Time not recognized by Sqlite DateTime

I am using the following code in Android to get current date time Date currentDateTime = new Date(); And storing it in the sqlite table as currentDateTime.ToString() SO in the table the values are stored like so 'Tue Sep 11 20:32:39 IST 2012' 'Thu Sep 13 17:23:38 IST 2012' 'Thu Sep 13 17:34:38 IST...
Vrashabh Irde
1

votes
1

answer
811

Views

How to add Date Header to an WebRequest

I am trying to add a 'Date' to an WebRequest Header.But it returns an error as 'The 'Date' header must be modified using the appropriate property or method. Parameter name: name'.I need to pass an Date header to an request. So I tried using HttpWebRequest,It has Date property. But what is my problem...
Girija
1

votes
1

answer
279

Views

How to configure web api's json serializer to convert date time into ISO 8601 format?

I am working on web api project and inside my WebApiConfig class I have added this configuration to convert datetime parameters into ISO 8601 format: IsoDateTimeConverter converter = new IsoDateTimeConverter { //DateTimeStyles = DateTimeStyles.AdjustToUniversal, DateTimeFormat = 'yyyy'-'MM'-'dd'T'HH...
Simple Code
1

votes
3

answer
215

Views

Date Format with Locale

I want to display date according to each country's date format. I have tried many ways finally I found this example http://www.java2s.com/Code/Java/Data-Type/DateFormatwithLocale.htm Which gives the perfect output of what I meant. Some countries like Germany won't use 12hr formats instead they uses...
Adhithya G Nair
1

votes
1

answer
319

Views

Pandas datetime format to prevent NaT

I am reading in an excel file into python with pandas. xls = pd.ExcelFile('filename.xlsx') df = xls.parse('Sheet1') I have a column in my dataframe (time_since_illness_onset) with datetime objects of the form: 1900-01-03 00:00:00 1900-01-04 04:30:00 I would like to parse these so that I have a col...
user42527
1

votes
1

answer
155

Views

Convert UTC timestamp to Simple binary encoded message

I am trying to convert UTC timestamp to simple binary encoded message. Would like to achieve what is mentioned in example here. Binary Encoding Example The following timestamp: UTC timestamp 14:17:22 Friday, October 4, 2024 is expressed in binary code (nanoseconds since Unix epoch) this way: 007420b...
shrishinde
1

votes
3

answer
317

Views

symfony3 datetime string in json object

My apologies in advance, if this has been answered before, I couldn't find the answer. And also, i thought i fixed it, but it got unfixed for no appearant reason. I have this code: $date = new \DateTime('now'); $dateFormatted = $date->format(\DateTime::ISO8601); $body->setDate($dateFormatted); this...
Glenn van Acker
1

votes
0

answer
53

Views

Plot data in R from Raspberry Pi temp sensor

Helping students with analyzing their data after they launch a weather balloon with a Raspberry Pi temp sensor. Trying to write some code for them in R to allow them to plot the downloaded data. A csv will be written & saved. I have put together some code and can't figure out how to convert the date...
Katherine Vittum
1

votes
1

answer
1.3k

Views

How to change format from 12hrs to 24 hrs in html5 datetime picker?

I am using datetime picker from Html5. But It is containing 12 Hrs time with A.M or P.M, But I want to set 24 hrs place of A.M, P.M. I am refering this link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local My problem is only I want to set 24 hrs in time.
V SH
1

votes
0

answer
68

Views

Json set Date Format - Print timestamp and epoch time both

I am using objectmapper.enable(SerializationFeature.INDENT_OUTPUT).writerWithDefaultPrettyPrinter().writeValueAsString(r); Result: 'begin' : 1513644267698, which returns the values in the object 'r' and the time in epoch format as stored. I now wish to print the time in a readable format, so i did t...
user3145771
1

votes
1

answer
1.6k

Views

Changing or add the time to a Date in VBA

I am working with a VBA project for Outlook. The project is looking at Calendar appointments and comparing them to dates pulled out of an SQL database and stored in a Date variable. Currently when the dates come out of the SQL database they not have any Time component to them but I would like to add...
Matt Bartlett
1

votes
0

answer
99

Views

String time passed from AsyncTask class variable not converting into date object in android but it works fine when i hard code the sting

String time passed from AsyncTask class variable not converting into date object in android but it works fine when i hard code the string. public class Main2Activity extends AppCompatActivity { String getdate, getday, gethijri, gettimezone, getfajr, getsunrise, getduhr, getasr, getsunset, getmaghri...
Ebad Lodhi
1

votes
0

answer
331

Views

Error parsing the date/time string: Wrong time format jquery timepicker

I'm working with the datetimeRange from jquery timepicker but it keeps indicating that I have the wrong time format, even though it looks like everything is exactly the same. Does anyone see where the problem is? I'm not sure if it's because of the UTC at the end. Error: Error parsing the date/time...
Stella Han
1

votes
0

answer
62

Views

How to convert Oozie batch start date property to a UTC format?

I have extracted a batch start date property this way: Configuration conf = new Configuration(false); conf.addResource(new Path(System.getProperty('oozie.action.conf.xml'))); String batchStartDate = conf.get('batch.start.date'); I want it to be in UTC. So I've created a DateTimeFormatter: DateTime...
samba
2

votes
4

answer
53

Views

How to set Datetime in Datatable Datetime column

I'm trying to store currant datetime in Datatable Datetime column using below code dtRow['dCurrantDate'] = DateTime.Now; but getting this error: Type of value has a mismatch with column typeCouldn't store in dCurrantDate Column. Expected type is DateTime.
Hardik Leuwa
1

votes
0

answer
22

Views

converting a datetime in pandas

I have the following datetime format (Mai 2, 2018 6:35:52 AM) which I want to convert to %Y-%m-%d %H:%M:%S.%f format, such as: 2017-05-13 21:11:01.436757 I have tried every way I can think of but get errors customer_file_path['RECEIVED_DATE2'] = customer_file_path['RECEIVED_DATE'].str.replace(',',''...
Pete Brush
1

votes
2

answer
112

Views

Parsing Twitter Created At Date as UTC

I realize there are many threads about parsing twitter dates, but I am having a peculiar issue, and haven't been able to find any threads specific to this. I am retrieving this post: https://twitter.com/bodegamcallen/status/1033757489567805440 which has a created date of 8/26/2018 at 9:46 AM Central...
SelAromDotNet
1

votes
0

answer
44

Views

Pandas merging several dfs date format error

The purpose of this code: Scrape a bunch of tables via Pandas and Beautiful Soup. Concatenate this tables into a single data frame. The code works fine for the first step. But it is not working in the second. And the problem is the date time format. In fact, I have two date formats 2018-09-24 01:30:...
Sayed Gouda
1

votes
1

answer
53

Views

How do I insert an empty DateTime to a ms access database?

My problem is that I dont know how to handle an empty LocalDate object. I have an excel sheet wich has a date column. The format is like this: 19693112 or 00000000 (if the date is not known yet) Inside my java application I change the format of the data and upload it to a database. I first convert t...
wenzel267
1

votes
1

answer
188

Views

How convert string in time format in angularjs controller

i have a dataset like this in my controller { 'schedule':[{'day':'Monday','start':'15:00:00'},{'day':'Tuesday','start':'16:30:00'}] } In my view i would like to use input[time] It doesn't work because it expects a date, not a string. How can I convert inside controller my string into time? I tried...
frwebdev
1

votes
2

answer
70

Views

Converting time to UTC time goes the opposite way

I'm trying to parse an offset time using Java 8 DateTimeFormatter. I live in EST time which is UTC-5, so when I try to convert 2019-01-22T13:09:54.620-05:00 should be --> 2019-01-22T18:09:54.620 However, with my code, it gets the current time and goes back 5 hours, resulting in 2019-01-22 08:09:54.6...
Xin Wenyu
1

votes
1

answer
44

Views

Npoi ICell.DateCellValue return NullReferenceException

I have this Excel column: Formatted as date data format: And I get NullReferenceException if I try to read the DateTime value. Do you know what is wrong here and how to fix it? Is it possible to convert the number into DateTime somehow? For example 31/12/9999 is 2958465 when I change to number forma...
Muflix
1

votes
0

answer
48

Views

how can i show my custom (Day-Month-Year Hour:Min:Sec) time format on chartjs chart?

I want to show my custom (Day-Month-Year Hour:Min:Sec -->ex: 01-05-2019 14:06:47 PM) time format on chartjs chart How Can i Show On chart xAxis Date Format Like This >> Day-Month-Year Hour:Min:Sec -->ex: 01-05-2019 14:06:47 PM time format is timeFormat = 'DD/MM/YYYY h:mm:ss a' but on chart only sho...
Amin Arjmand
1

votes
3

answer
90

Views

How to get system date and time format in java? [duplicate]

This question already has an answer here: How can I set date and time formatting in Java that respects the user's OS settings 7 answers How to get the current date/time in Java 25 answers I'm trying to read current system date and time format in java, but after analysing i couldn't find any method...
kadharbasha
1

votes
1

answer
15

Views

Symfony4 DateTimeType as single_text widget not formatting correctly

This problem is starting to drive me mad and I can't seem to find any correct information or documentation regarding this problem. I'm using symfony 4.2.3 I have a form with a dateTimeType : ->add( 'startDate', DateTimeType::class, [ 'widget' => 'single_text', 'input' => 'datetime', 'html5' => false...
Dennis de Best
1

votes
2

answer
77

Views

Datetime format help

I want only Hr and Min in time format so i did select convert(varchar(20),GETDATE(),108) ===>> output is '12:57:54' but i want only '12:57' this much so how i will do that in sql server
Amit Patil
1

votes
2

answer
31

Views

Pandas to_datetime changes year unexpectedly

I have a date column which after using pandas read_csv is represented as the object type. I'm trying to convert it to pandas datetime object but when using pd.to_datetime() it returns incorrect datetime object. for example, I have dates in this format 01-06-68, where 01 is the day, 06 is the month a...
1

votes
1

answer
87

Views

Activerecord removes all zeros from the timestamp field

I am using Ruby on rails. I am trying to retrieve timestamp column from particular table. Activerecord returns me the date, if timestamp contains all zeros. e.g: If timestamp stored is 2010-09-06 00:00:00:000, it returns me 2010-09-06. But if I have 2010-09-06 00:00:20:000, it returns me in the exp...
SachinJadhav
1

votes
1

answer
3.2k

Views

GNUPlot TimeFmt Issue

So I'm pretty new to GnuPlot, and I can't seem to find out why I'm getting the error I am. Here's a sample of my data.txt file in the format (irrelevant id,name,time) : 3|Harpos|2010-08-28 02:44:55 4|Harpos|2010-08-29 02:22:25 5|Harpos|2010-08-29 02:09:19 26|Harpos|2010-09-03 03:01:09 With the follo...
user546459
1

votes
1

answer
842

Views

Error submitting form with date field

I get the following error in a page where I use a datepicker. No matter what day is inserted, this error happens: 14-Fev-1991. What is that? Today is 14-Fev but not 1991! What should I do? String was not recognized as a valid DateTime. [FormatException: String was not recognized as a valid DateTime....
Fabio Milheiro
1

votes
1

answer
1.7k

Views

How can I format java.sql.Timestamp in a XML way using XStream?

I have some Java objects that I want to transform to XML. Some of the objects has a field java.sql.Timestamp datetime and I want them formatted in XML as datetimes is usually formatted in XML. From what I know datetimes in XML should contain a T or a Z for UTC time. But if I use XStream the java.sql...
Jonas
1

votes
1

answer
1.2k

Views

ASPxDateEdit Change Header

Is there any way to modify the format of the calendar header of DateEdit control? Before upgrading to v.10.2.8.0 (I was using 10.1.6.0) the format of the calendar header was MMMM, YYYY (e.g. July, 2011). After upgrading, the format changed to YYYY MMMM (e.g. 2011 July). Any help will be appreciated....
KaeL
1

votes
2

answer
1.2k

Views

Display Persian time in format hh:mm

I am using a persian calender on my application , i am using that code : using System.Globalization; [...] PersianCalendar pc = new PersianCalendar(); DateTime thistime = DateTime.Now; string persiantimenow = pc.GetHour(thistime) + ':' + pc.GetMinute(thistime); Console.WriteLine(persiantimenow); It...
BOSS
1

votes
1

answer
571

Views

Convert entered date into UTC in JavaScript based on browser location

My app will be run in Mexico and Australia. When a user selects a date I format it as; 'Friday 17 August 2012' Now, how do I convert that string value into a UTC date? So far I have this; var enteredDate = $('.CreateDateRange').val() + ' 07:00:00'; var thisDate = new Date(enteredDate); var utcDate =...
griegs
1

votes
2

answer
1.4k

Views

How To Convert A Foreign Month In A Date String Into English

The below answer to another thread seems to make a start on what I think I need, but I am having difficulties in implementing it. The best library for that purpose would probably be Globalize. It allows you to specify the locale (it is called culture but it is actually the same), the format (built-i...
user1698664
1

votes
1

answer
384

Views

Convert Windows 64-bit filetime structure format with XSL

Following this suggestion: How to convert ticks into a readable datetime with XSLT? which shows how to convert Unix timestamp format in human readable datetime format, I wanted to convert Windows 64-bit filetime structure with XSL: where @WDT attribute represents Windows 64-bit datetime number. Howe...
theta
1

votes
3

answer
2.5k

Views

converting string to datetime using DateTimeConverter

I want to convert a date in string format into Datetime without spliting it.I tried but any of those not working properly.can I do this by using DateTimeConverter . I have no idea about DateTimeConverter
Shanika Nishani
1

votes
4

answer
15.6k

Views

Convert different format of DateTime to specific String format

Im Getting System.datetime.now from different Machine .Each system having different datetime format as a mension below 16-Oct-12 7:25:22 PM 16/10/2012 7:10:47 PM [DD/MM/YYYY] 10/16/2012 7:10:51 PM [MM/DD/YYYY] How To convert Different format of DateTime to specific String format ? string sDateTime...
Bala Kumar
1

votes
1

answer
6.8k

Views

Change System DateTime Format c#

I need to change/update/set my system (windows7) default dateTime format programatically and permanently until I change it myself through code or through windows GUI I have tried a lot of solutions like this one from Code Project Console.Write(DateTime.Now + ''); RegistryKey rkey = Registry.CurrentU...
Sami
1

votes
1

answer
402

Views

WPF application customize shortdate when using stringformat={}{0:d}

We are trying to allow the app to have its culture set at runtime and optionally override the way dates are displayed. We create our own culture with: private CultureInfo CreateCulture() { // start with basic culture object CultureInfo culture = Sys.Workspace.ServerProperties.UICulture ?? new Cultur...
Jon

View additional questions