Questions tagged [sql-timestamp]

263 questions
0
votes
2 answers

Checking for a new day using sql.timestamp

I'm working with some legacy code and I'm iterating through some values, the legacy code is checking for the start of a new day using an sql.timestamp value: public static final long MILLIS_PER_SECOND = 1000; public static final long…
JTK
  • 1,469
  • 2
  • 22
  • 39
0
votes
1 answer

MySQL: group by hour AND by other distinct fields

I have a 'logs' table, in which search results' counters are stored, as well the search query and the user who searched for it. My goal is to display results grouped by hour, but I'm having some issues when using GROUP BY because I'm losing the…
Anonymous
  • 850
  • 2
  • 12
  • 26
0
votes
1 answer

How to convert the string as timestamp

$current_date=date('Y-m-d'); $time = strtotime("$current_date -0 years -0 months -1 days"); $date = date("Y-m-d", $time)."
"; the $date holds 2015-10-08 as value. but when i use this value in sql statement, it does not pull records. i did…
user5422072
0
votes
2 answers

Using Timestamp in java sql prepared statement

I am trying to execute a select query using prepared statement in Java. In Where clause im checking for a condition on Timestamp type column as shown below. String selectSQL = "select * from db.keycontacts WHERE CREATEDDATETIME>?"; PreparedStatement…
Rajesh Rs
  • 1,301
  • 5
  • 24
  • 48
0
votes
2 answers

how to put current time in database for different locale?, even if in android mobile device time is not set in android

hello my bro & sis i am new in android, currently i am working in android database site. my application user used app from the multiple country, So my problem is how can i insert current time of every user from different locale wise when user…
Mansukh Ahir
  • 3,373
  • 5
  • 40
  • 66
0
votes
0 answers

ClassCastException: Cannot cast java.sql.Date (id=9010) to java.sql.Timestamp

I am having a problem with a Java 1.4 app. I am executing a JDBC Qyery-which is 2 date fields in an Oracle database (both the 2 fields I am reading is of type DATE with NULLABLE = false) SELECT effFrom, effTo FROM myTable WHERE .... And is exceuted…
cp5
  • 1,087
  • 6
  • 26
  • 58
-1
votes
1 answer

Converting string to Timestamp in BigQuery without timezone

Earlier team had createddate as string and now we are moving it into timestamp column and currently migrating it into timestamp. But running into an issue when converting string to timestamp only with 3 digit milliseconds and without…
gcpdev-guy
  • 460
  • 1
  • 10
  • 23
-1
votes
1 answer

SQL timestamp not converting to OffsetDateTime

I have a sql timestamp that is being returned from a query in java. I need this date as an OffsetDateTime type, but my attempts to parse it have failed. I've tried the following. What other steps do I need to take? I'm iterating through the sql…
Great Gale
  • 71
  • 1
  • 8
-1
votes
1 answer

work thing, need help - how to split ranges that overlapping?

I have 3 tsranges that overlap like the figure below, how can I divide them so that we have 0-1 black, 1-2 green, 2-3 black, 3-4 green and 4-5 black? like img2? i've tryied to agregate them but cant gat the black time between the…
-1
votes
1 answer

SQLite rounding timestamp up nearest 5 minute

I have a table that has a timestamp column called 'time' and an integer column called 'number'. I want to do a query so that the timestamp is rounded up e.g. 2022/02/22 13:03:45 becomes 2022/02/22 13:05:00 and I also want to count the number of…
bob
  • 1
-1
votes
2 answers

How to Change Timestamp in DDMMMYYYY HH:mm:ss:ssssss format to yyyy-MM-dd format in spark sql

I have a timestamp in the below format. How to get date in yyyy-MM-dd format from it? +-------------------------+ |15APR2021:03:53:54.458387| |15APR2021:03:53:53.830339| |15APR2021:03:53:54.297856| +-------------------------+ I have tried using the…
Manoj Kumar G
  • 492
  • 8
  • 18
-1
votes
1 answer

pyspark: change string to timestamp

I've a column in String format , some rows are also null. I add random timestamp to make it in the following form to convert it into timestamp. date null 22-04-2020 date 01-01-1990 23:59:59.000 22-04-2020 23:59:59.000 df…
-1
votes
1 answer

How to get difference between 2 timestamp values in SAP Hana?

I have two column timestamps values and would like to find out difference between those times in SAP HANA. I have not found any easiest way to find out like other DB. For better understanding, an example has been given in the following. COLUMN1: …
-1
votes
3 answers

Subtract 3 weeks from current timetamp

How can I get the current timestamp - x number of weeks using java.sql.Timestamp; This is my current timestamp Timestamp.from(Instant.now(clock)); x- could be any number from 0-5
Neethu Lalitha
  • 3,031
  • 4
  • 35
  • 60
-1
votes
1 answer

Multiplying a timestamp data for several times in BigQuery

I have a time-series starting from 2017-01-01 00:00:00 to the end of 2017-12-31 23:00:00 for 1-hour interval. I need to duplicate this 1-year timestamp for 2400 times in the same column. I need help about this one.. Row Date_time 1 2017-01-01…
1 2 3
17
18