date-conversion

MYSQL: How to convert a string into a month (Number) [duplicate]

我只是一个虾纸丫 提交于 2019-12-06 08:53:44
问题 This question already has answers here : MySQL MONTHNAME() from numbers (5 answers) Closed 6 years ago . I have the short version of months: JAN, FEB, MAR , etc. and would like to convert them to it's respective numeric value: 1, 2, 3 , etc Also, I would like to be able to change back and forth between the numeric-month-value, to a "short" month name ( JAN, FEB, MAR ) and it's long version ( January, February, March , etc) NOTE: As @dipu-raj pointed out, this is not a duplicate because I am

How to split minutes into days, hours and minutes in tsql

感情迁移 提交于 2019-12-06 00:40:23
I have a column which consist of minutes. Is there any simple way to split minutes column into one column which shows days, hours, minutes only? DURATION ----------- 67 ==> 1 hour, 7 minutes 1507 ==> 1 day, 1 hour, 7 minutes 23 ==> 23 minutes I googled for solution but I didn't find any solution similar for me. I want to show this in a report but trying to find how can I solve this column looks meaningfully. Duration column's calculation like this. avg(datediff(MINUTE, ei.SentDate, eo.SentDate)) over(partition by ei.mailbox) as DURATION A google search landed me here http://www

Convert From Hijri to Georgian date in ASP & C#?

荒凉一梦 提交于 2019-12-05 22:31:38
I have two text boxes, One in Hijri Date which I am inserting date in this text box using the calender extender. What I want is that upon selection of date (Hijri Date), the Georgian text box will filled with converted Georgian date using C#. Does anyone has code for changing the hijri date to georgian date? You can simply convert between Hijri and Gregorian using the built in CultureInfo class Imports System.Globalization Private Sub Convert_From_Hijri_To_Gregorian(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim arCI As CultureInfo = New CultureInfo("ar

Convert XMLGregorianCalendar in GMT to LocalDateTime Pacific time

白昼怎懂夜的黑 提交于 2019-12-05 21:04:22
I'm trying to convert XMLGregorianCalendar which is sent in GMT/UTC format to Java 8 LocalDateTime in America/Los_Angeles timezone with no luck. Here is what I tried and couldn't get the time converted to Pacific time. //xmlDate is 2017-11-13T00:00:00Z ZonedDateTime zDateTime = xmlDate.toGregorianCalendar().toZonedDateTime().toLocalDateTime().atZone(ZoneId.of("America/Los_Angeles")); LocalDateTime localDateTime = zDateTime.toLocalDateTime(); //Expected localDateTime is 2017-11-12T16:00. But I only get 2017-11-13T00:00 What am I missing? atZone() does not do what you think it does. It merely

MYSQL: How to convert a string into a month (Number) [duplicate]

眉间皱痕 提交于 2019-12-04 13:44:57
This question already has answers here : MySQL MONTHNAME() from numbers (5 answers) Closed 6 years ago . I have the short version of months: JAN, FEB, MAR , etc. and would like to convert them to it's respective numeric value: 1, 2, 3 , etc Also, I would like to be able to change back and forth between the numeric-month-value, to a "short" month name ( JAN, FEB, MAR ) and it's long version ( January, February, March , etc) NOTE: As @dipu-raj pointed out, this is not a duplicate because I am asking the opposite to MySQL MONTHNAME() from numbers and the answer IS different as well BECAUSE it

Converting timestamp in microseconds to data and time in r

冷暖自知 提交于 2019-12-04 05:33:51
问题 I'm trying to convert a timestamp in microseconds to the following format in R: YYYY-MM-DD HH:MM:SS I've tried different approaches, but couldn't succeed. Following my code: options(digits=16) value = 1521222492687300 as.POSIXct(value, tz = "UTC", origin="1970-01-01 00:00:00") And I get this as return: [1] "48207591-10-13 12:15:00 UTC" Even divided by 1000, as some posts suggested, I'm still getting a non sense result: as.POSIXct(value/1000, tz = "UTC", origin="1970-01-01 00:00:00") [1]

Convert Json date to java calendar

て烟熏妆下的殇ゞ 提交于 2019-12-04 01:53:01
问题 I have the following value /Date(1234043600000)/ in string type and I need to convert it to java calendar type without a success,I have tried to use the following post and create date and than do something like the post How do I format a Microsoft JSON date? Date date = new Date(parseInt(jsonDate.substr(6))); and than do someting like Calendar cal = Calendar.getInstance(); cal.setTime(date); I got error in the first line since in the word date i have line in the middle and substr(6) have

Conversion failed when converting date and/or time from character string in SQL SERVER 2008

一曲冷凌霜 提交于 2019-12-04 01:30:49
问题 I have below SQL. UPDATE student_queues SET Deleted=0, last_accessed_by='raja', last_accessed_on=CONVERT(VARCHAR(24),'23-07-2014 09:37:00',113) WHERE std_id IN ('2144-384-11564') AND reject_details='REJECT' when I ran the above SQL the below exception has been throwed. Conversion failed when converting date and/or time from character string. 回答1: If you're trying to insert in to last_accessed_on , which is a DateTime2 , then your issue is with the fact that you are converting it to a varchar

In SQL Server, how to convert a date to a string in format M/D/YYYY? (no leading zeros, not MM/DD/YYYY)

社会主义新天地 提交于 2019-12-04 01:29:20
Right now, my code has the following conversion for a date field: convert(varchar, Citation.PublishedOn, 101) However, that returns dates like 03/01/2010. The request was to have the dates display as 3/1/2010 (without the leading zeros, but with a 4 digit year). I've looked at http://msdn.microsoft.com/en-us/library/ms187928.aspx and I'm not seeing anything that explicitly excludes leading zeros. How do I format the date to exclude leading zeros? This is how I would do it: DECLARE @dt datetime SET @dt= Citation.PublishedOn SELECT LTRIM(STR(MONTH(@dt)))+'/'+LTRIM(STR(DAY(@dt)))+'/'+STR(YEAR(@dt

How to get datepicker value in date format?

前提是你 提交于 2019-12-03 17:06:58
问题 I have a problem with my Datapicker i use the code for getting date,month & year shown below DatePicker datePicker; datePicker = (DatePicker) findViewById(R.id.dateselect); int day = datePicker.getDayOfMonth(); int month= datePicker.getMonth() + 1; int year = datePicker.getYear(); but when i print the date it shows the value 7 not 07 and for month it shows the value 2 not 02 I want these integer data in a date format ie; eg: 02-02-2013, 24-12-2013 Is there any possible way???? 回答1: public