Questions tagged [date]

A date refers to a specific day marked on a calendar, incorporating details of the year, month, and day. Discuss topics related to generating, manipulating, and preserving date information within various programming languages.

Effective methods for eliminating timezone in JavaScript

I need to display the time and format {{transaction.submitTime | date:'yyyy-MM-dd HH:mm:ss Z'}} Currently, it displays 2015-04-23 02:18:43 +0700 However, I would like to show the time without +0700, where the hour will be incremented by 7. Is ...

Generate a fresh Date/Time by combining individual Date and Time components

I have set up a form to gather dates from one input box and times from another. var appointment_date = new Date(); var appointment_start = new Date("Mon Apr 24 2017 20:00:00 GMT-0400 (EDT)"); var appointment_end = new Date("Mon Apr 24 2017 21:30:00 GMT- ...

Unexpected behavior: Angular4/Javascript Date object alters when timezone is specified in Date constructor

In my Angular 4 application, I encountered an issue with a date retrieved from an API call. The date is in the format '1990-03-31T23:00:00-06:00' and when attempting to create a Date object and retrieve the month using getMonth(), it returns the wrong day. ...

What is the technique for arranging the display of a component in React?

Is there a way to dynamically render a component in my react-app at a specific date and time, like 6.00PM on October 27, 2022? I want to release a form for signing up starting from that exact moment. The timestamp information will be stored in my database ...

Material-UI Date Selectors: Show the Date in (Month, Day, Year) Format -> (April 17, 2019)

If you're using the Material-Ui Pickers library, check out this link for more information: It appears that you can display the date as a (Month Day) string or as a (MM/DD/YYYY) format. However, I'm wondering if there is an option to display the ...

Determine revised date values by conditionally incorporating an extra month or deducting one

For my PHP project, I have to perform some date-related checks in order to fetch data from the database based on user input. Currently, I am using the following code snippet: if ($request->flagMonth == -1) { $query->where( ['month&ap ...

Preventing users from entering past dates in Angular 6 - A step-by-step guide

Here is my current code snippet: ngOnInit() { let now = new Date(); this.date = formatDate(now, "dd/mm/yyyy",'en-US'); console.log("dateFormat :",this.date); } This is the html part of my code: <input type="date" [min]={{da ...

Enabling the acceptance of blank values within an HTML5 date input field

When using an HTML5 date input for a field that corresponds to a nullable datetime column in the database, how can one avoid setting an empty value in the input field? In my AngularJS application, the ng-model is connected to a scope variable with an init ...

A JSON-based implementation for regular expressions that validate and parse new Date objects

I'm struggling with a specific regular expression. My current code is: "sampleDay": newDate(1402027200000) However, I need to display only this portion: 1402027200000 Using Java, I have managed to remove the entire date using the following line of code: ...

The D3.js text element is failing to show the output of a function

I'm having an issue with my chart where the function is being displayed instead of the actual value. How can I make sure the return value of the function is displayed instead? The temperature values are showing up correctly. Additionally, the doesn't s ...

Angular's minimum date validation is not accurate for dates prior to the year 1901

Any assistance or clarification on this matter would be greatly appreciated. It appears that there may be an issue with my implementation, as otherwise it seems like a significant bug within Angular. Setup Create a form with a minimum date of 0001-01-01 ...

Are there any solutions for the malfunctioning v8 date parser?

The V8 Date parsing functionality is not functioning properly: > new Date('asd qw 101') Sat Jan 01 101 00:00:00 GMT+0100 (CET) I have attempted to use a delicate regular expression like the following: \d{1,2} (jan|feb|mar|may|jun|jul|a ...

Refine the Crossfilter dimension according to the specified date range

What is the proper way to filter a date range using Crossfilter? The code above does not seem to yield any results, but I am certain that there are records within that specified time period. Var myDimension = CrossFilterObj.dimension(function(d) { retur ...

Counting the days: how to calculate without using negative numbers

After performing the calculation, the result shows -30. Is there a way to eliminate the negative sign and get 30 instead? $days = (strtotime(date("Y-m-d")) - strtotime($info['expiredate'])) / (60 * 60 * 24) echo abs($days); Any suggestions on the optima ...

The standard date format used in Javascript/Jquery programs

I have a kendo date picker set to display dates in the format "MM/dd/yyyy". I need to use jquery or javascript to ensure that the selected date is not in the future and is greater than '01/01/1900'. The problem I'm encountering is handling ...

sort response data based on date in vue

Is there a way to sort response data by date in vue2? Specifically, how can we filter the data by month, year, or week when a corresponding button is clicked? Here's an example of the response data I received: [ { "date": "2017-02-05", "views": 1, "r ...

Issue with Dates in Typescript array elements

When attempting to compare different Date elements in my code, I encountered an issue. I have two date elements representing date formats but am unable to compare them because I keep receiving the error message "core.js:6237 ERROR TypeError: newticketList. ...

The mu-i datepicker icon has been updated, but unfortunately, it is no longer clickable

I recently customized the Datepicker component in the Material-UI (MUI) framework by adding an icon to the slot parameter. While this customization was a success, I encountered an issue where the Datepicker does not open when clicking on either the added ...

Check to see if the upcoming birthday falls within the next week

I'm trying to decide whether or not to display a tag for an upcoming birthday using this boolean logic, but I'm a bit confused. const birthDayDate = new Date('1997-09-20'); const now = new Date(); const today = new Date(now.getFullYear(), now.getMonth(), n ...

Parsing dates in an Excel file and transforming them into separate text strings

After beginning to work with Python, I encountered a situation where I have a list of dates in an Excel file. The dates are formatted as follows: 01-05-2021 02-05-2021 . . 29-05-2021 Now, I need to import this column into Python and convert each dat ...

Employing strtotime to locate the date preceding a specific date

Hey there, I've got a quick question that has been puzzling me lately. I have a specific date, like "first Sunday in April," and I'm trying to figure out the day before using the strtotime function in PHP. I thought about how this task would be more compli ...

Is there a way to determine if a chosen date and time are prior or subsequent to the current date and time in an AngularJS environment?

When using a datepicker and timepicker, I have obtained a selected date and time. Now, I need to determine if this selected date and time is before or after the current date and time. For example, if the selected date is "Sat Dec 12 2015" and the selected ...

Converting jQuery datetime to UTC and ISO string format

When trying to convert a date to UTC and ISO format in jQuery, I am encountering an issue where the result is always one month later than expected. Below is my code: var x = new Date(2015,09,1).toISOString(); The resulting value of x is shown below: x = ...

How can I revert a date format using date-fns?

Greetings from Thailand! I have a question regarding the reverse formatting using date-fns. Is there a way to create a function that will change "saturday-9-september-2564" back to "2022-09-24" using date-fns? Any insights or methods on achieving this wo ...

Having trouble calculating the number of days between two dates at this moment

I'm working with a code snippet that involves comparing two dates – a specified date and the current date. However, when trying to calculate the difference in days between these dates, I keep getting either 0 or an unexpectedly large number like "31536 ...

"Is there a way to initiate a Date Picker with the current date using Javascript in an AngularJS application

I am having an issue with my date picker where the month starts from the current month and goes up to the next 12 months. However, I only want to display dates from the current date to the last date of the current month. I believe I need to set a limit so ...

What is the method for setting the start day of the week to Wednesday in material-ui-pickers?

Is there a way to set Wednesday as the start day of the week in material-ui-pickers? By default, Sunday is being displayed as the start day. Is there a method to change this setting? Appreciate any help on this matter. ...

The error message java.lang.NumberFormatException: Unable to parse the input string: "2017-01-28 13:28:20" occurred

During the execution of my java project, I encountered an error with a Gson deserializer function. The error message states: java.lang.NumberFormatException: For input string: "2017-01-28 13:28:20" at java.lang.NumberFormatException.forInputString(NumberF ...

Ways to determine if a date matches today's date within a component template

I am currently displaying a list of news articles on the webpage and I want to show the word "Today" if the news article's date is equal to today's date. Otherwise, I want to display the full date on the page. Is there a way to compare the news.D ...

What is the best approach for generating individual variables for every row in a React table?

Presently, I am developing a dynamic table using react and the structure is as follows: <TableBody> {finalLoadedTokensData.map((loadedToken, index) => { const isItemSelected = isSelected(loadedToken.contract); const label ...

Determine the year of the end date with PostgreSQL

Context Users have the ability to select specific date ranges, which can be seen in the screenshot below: All combinations of starting month/day and ending month/day are valid, such as: Mar 22 to Jun 22 Dec 1 to Feb 28 The second combination presents ...

Obtain the date in ISO format without subtracting the timezone offset

I need to obtain a Date string without the timezone being added or subtracted. Currently, when I set my OS timezone to GMT +13 and create a new Date() object, the toISOString() method subtracts one day. For example, today is 11/02. If I adjust my OS time ...

ERROR: PipeError - Conversion of "Invalid Date" to a date is not possible for the DatePipe

While attempting to format a date with time, I ran into an error. The way I am sending the request is as follows: created = this.datePipe.transform(dateCreated, 'yyyy-MM-ddTHH:mm'); I require the time in order to consume a service that necessitates this ...

Display the date that is 3 days after the selected date from the Date Picker in the text field

This is the date picker code I am currently using: var d = new Date(); $(function () { $("#datepicker").datepicker({ minDate: d, dateFormat: 'mm-dd-yy' }); }); I want to enhance this functionality so that when a date is selected, ...

Verifying the date displayed using Java in Selenium

I am attempting to retrieve the date in a specific format to validate if it follows MM/dd/yyyy HH:mm. I've attempted: element.getAttribute("value") but it returns "yyyy-MM-ddTHH:mm" which does not match the UI display. Furthermor ...

Sending a POST request in Python does not modify the original date displayed in the response

view image description hereWhen attempting to submit form data on the , I receive a response, but it doesn't reflect the dates I provided in my post. Below is the code snippet I am using: import requests.sessions url = "https://seffaflik.epias.com.tr ...

CodeIgniter throwing a date error when it is being hosted

Attention: The date() function may not work properly due to the system's timezone settings. It is essential to specify the date.timezone setting or utilize the date_default_timezone_set() function. If you are still encountering this warning after implement ...

Guide on transforming UTC time from the server to the local time of users during a GET request

I am currently facing a challenge where I need to verify if the date of the last time an element was clicked matches the current date. Due to my server generating the current date which is 5 hours ahead of my local time, there is a discrepancy causing the ...

Using a combination of Ajax and jQuery in Rails4 to showcase a date in the %m/%d/%yyyy format ultimately results in a split

Recently, I encountered an issue with an ajax call that retrieves a date from the database. The date is stored as a double in the database and then converted to a string. I used Date.parse to change it into a date object and used strftime to format it. How ...

What is the best way to calculate the number of days between today's date and the end of the current month using Moment.js?

Here's the current code snippet I am working with: const moment = require('moment') const m = moment const currDay = m().format('D') const dayOfWeek = m().format('dddd') const daysInMonth = m().daysInM ...

Translate data from two "contact form 7" date fields into JavaScript/jQuery to display the date range between them

NEW UPDATE: I was able to get it working, but the code is a bit messy. If anyone can help me clean it up, I would greatly appreciate it. <div class="column one-fourth" id="date-start">[date* date-start date-format:dd/mm/yy min:today+1days placeholde ...

Validate the date selected in a dropdown menu using JavaScript

I'm still relatively new to Javascript, just working my way through some tutorials. I have three select boxes in my HTML form as shown below. HTML Form: <table> <form id="enrolment" name="enrolment" onsubmit="return datevalidate();" action ...

Setting today's date as the default option for the Material UI datepicker

I'm having trouble setting today's date as the default in my React app using Material UI datepicker. Here is the snippet of my code: <TextField id="dateTimeFrom" type=" ...

Trouble with Moment.js - Unable to update date to "pt-br" (ReactJS)

I am currently developing a calendar in Portuguese using ReactJS. Even though it seems like a simple task, I am facing an issue trying to display the dates in Portuguese (Brazil) using the "moment.js" library. I have already attempted the following code: ...

converting JSON to date format in angular

.controller('feedCtrl', ['$scope', '$http', function($scope, $http) { $http.get('items.json').then(function(response) { $scope.items = response.data; $scope.user = localStorage.getItem("glittrLoggedin"); }); }]) JSON file: [ { "_id" ...

AngularJS: A guide on retrieving time from a date string in JSON format

Is it possible to extract a formatted time string from incoming JSON data without using moment.js in AngularJS? Sample HTML Code: <div ng-repeat="event in events | limitTo:1"> <div class="row spot"> <span class="orange">Whe ...

php for the upcoming week and the following week

I have successfully retrieved the date of the Monday for the current week, but I am unsure how to display it along with the date for the following week's Monday in a sentence. Can someone assist me with this issue? For instance, I would like the outp ...

PHP script using SQL SELECT query to retrieve records with dates greater than a specified value, including dynamic PHP variables

After reading through various threads on this issue, I still haven't found a solution that incorporates php variables. I am trying to retrieve the first 100 new records after a specific date from my database, but I'm struggling to make it work. ...

How can I calculate the total number of days between the from_date and to_date using PHP in CodeIgniter?

$from_date = $this->input->post('from_date');12/3/2016 $to_date = $this->input->post('to_date');14/3/2016 I am looking for a solution that will provide me with the total number of days between two dates. For example, consid ...

Alter the language settings of the Datepicker feature in Material Angular 4

Need help changing the language of Datepicker in Material Angular. Struggling to locate this information in the Angular material 2 documentation. Check out this plunkr https://plnkr.co/edit/unzlijtsHf3CPW4oL7bl?p=preview <md-input-container> < ...

Filtering dates in AngularJS with UTC timezone

Can AngularJS convert a JSON date format like the following: 2014-01-29T21:45:24 +05:00 into a more readable date format like this: January 29, 2014 Check out this JSBin demo for an example. ...

What is the most efficient way to calculate the number of days between today's date and May 20, 2011 using PHP?

Similar Question: How can I calculate the number of days between two dates using PHP? I've seen a JavaScript solution, but I'm looking for a PHP alternative. Any suggestions? ...

How can I use Jupyter (Python) to exclude columns containing dates from my dataset?

In search of a program that can specifically identify columns with dates stored in them. While Python's .dtypes function may classify dates, strings, and other fields as objects, I require a solution that exclusively targets columns containing valid date ...

Tips for using Angular's formatDate function to format dates

I am attempting to achieve a specific format using Angular's formatDate "2019-01-01T00:00:00Z" Here is the code I am using: formatDate( '2019-01-01', 'yyyy-MM-ddT00:00:00Z', 'en-US' ) The output I am getting is ...

What is the best way to process a date string and format it in TypeScript?

My task involves receiving a date in string format as 20160229000000 ('YYYYMMDDhhmmss'). I need to take this string and display it in DD-MON-YYYY format using Typescript. Instead of relying on an angular package like DatePipe, I am working with OJET and ...

Obtain the last day of the month using PHP Datetime with a combined modifier value

Trying to create a Datetime 3 days after the last day of this month using a date from a constructor with this code: (new Datetime('2019-01-01'))->modify('last day of this month, +3 days')->format('Y-m-d') The expected ...

AngularJS does not recognize Model as a date object in the input

I am attempting to utilize AngularJS to showcase a date using an input tag with the type attribute set to date: <input ng-model="campaign.date_start" type="date"> Unfortunately, this approach is resulting in the following error message: Error: err ...

In TypeScript, the catch block does not get triggered

I created a custom pipe in Angular that is supposed to format passed parameters to date format. The pipe contains a try-catch block to handle any errors, but surprisingly the catch block never seems to be executed even when an invalid date is passed. impo ...

Creating a date input mask for HTML text inputs with PHP

Can a date mask be applied to an HTML text input using a regular expression or another method? I need the text input to only accept numbers in the format of: dd/mm/yyyy I have seen examples using JavaScript, but not PHP. Appreciate your help. ...

Is there a way to change an ISO 8601 date into the format '/Date(1525687010053)/' using JavaScript?

Is there a way to convert a date value that is formatted as 9999-12-31T00:00:00Z to the format /Date(1525687010053)/ using javascript? I tried implementing the following code, but it doesn't seem to be working: var datevalue = '9999-12-31T00:00 ...

Changing date format in Mui DatePicker

I need some assistance with customizing the mui DatePicker. Specifically, I would like to set the date format to display as Day, DD Month. For example: Monday, 10 September Below is the code snippet I am currently working with: <LocalizationProvider d ...

Explore registrations by year and month

I am currently working on coding where a record needs to be displayed based on the date (Month, Year), for instance: 12-2022. However, with the current code I have, I am unable to achieve this. Can anyone offer some guidance on what steps I should take? ...

Convert the date into a string format instead of a UTC string representation

I am currently working on a node.js project using TypeScript. In this project, I have a Slot class defined as follows: export class Slot { startTime: Date; constructor(_startTime: Date){ this.startTime = _startTime } } // Within a controller method ...

How to manipulate dates using Angular 2's date pipe to add or subtract hours

I am encountering an issue with the new Angular 2 Date Pipe. My date value is as follows: let myDate = '2017-01-31T17:53:36' When I use the Date Pipe to format it in the view like this; {{myDate | date: 'dd/MM/yyyy HH:mm' }} It displays the local time ...

The attempt to retrieve the desired date format using regular expressions was unsuccessful

I've been attempting to use a regular expression to extract dates from text details, but unfortunately, the expression I'm using doesn't return any results. Here's the PHP code snippet I have for extracting dates: <?php preg_match( ...

JavaScript incorrectly constructs date strings

Hey there, I've been attempting to create a JavaScript date object using a string but for some reason, it's consistently off by one day. Every time I try, it ends up showing the wrong day. Below is the code snippet in question: var date = new Date('2006-0 ...

Updating the month involves the process of parsing dates

Here's the code I'm using to parse a date in the format "DD/MM/YYYY" for INTAKE_DATE, which is currently set to "2015-04-20": String INTAKE_DATE = rs.getString("INTAKE_DATE"); //"2015-04-20" System.out.println(INTAKE_DATE); java.text.DateFormat ...

Using Vue to pass the outcome of a function for date parsing

Is there a way in VUE to pass the result of currentView.lastSuccessRunDate, perform some operations on it, and display the modified output in a table instead of directly using the API response? I'm looking for a function that can take this response as a pa ...

If the specified date is not found in the queryset, then insert a default

While working on integrating django with chartjs, I have utilized a class-based view as shown below. class SingleTagChartJSONView(BaseLineOptionsChartView): def get_context_data(self, **kwargs): context = super(BaseLineChartView, self).get_con ...

Preventing selection of past dates in PHP input fields

<input id="datepicker" name="datepicker" class="calendar" /> Here is the unique script: <script> $(function() { $( "#datepicker" ).datepicker({ minDate: 0}); }); </script> here php excerpt. if( $date < strtotime ...

Changing a string into a JavaScript date object

I am encountering an issue where I have a string retrieved from a JSON object and attempting to convert it to a JavaScript date variable. However, every time I try this, it returns an invalid date. Any insights into why this might be happening? jsonObj["d ...

problem encountered when trying to convert dtype('O') to a date format

Hey there, I'm encountering an issue with dates in my raw dataset (under the column name 'earliest_cr_line'). When I checked the dtype on Jupyter, it showed as dtype('O'). In order to convert it to a datetime format, I used the cod ...

Locate the nearest date (using JavaScript)

Searching for the nearest date from an XML file. <?xml version="1.0" encoding="UTF-8"?> <schedule> <layout fromdt="2014-01-01 00:00:00" todt="2014-01-01 05:30:00"/> <layout fromdt="2014-02-01 00:00:00" todt="2014-01-01 05 ...

More efficient methods for handling dates in JavaScript

I need help with a form that requires the user to input both a start date and an end date. I then need to calculate the status of these dates for display on the UI: If the dates are in the past, the status should be "DONE" If the dates are in the future, ...

How to format PHP time differences according to the number of days

Currently, I am using this PHP code to calculate the time difference and display it in days, hours, and minutes. // Comparing expires_at with current time $now = new DateTime(); $future_date = new DateTime($contest->expires_at); $interval = $future_da ...