multithreading – Java 8 ThreadLocal Date With Lambda

I’m using Java 8 lambdas to initialize thread local date variable.
I am accessing these methods in multithreaded program.
Is it going to create garbage references as I am not using .remove() method on thread local variable. ?
As mentioned here:
https://stackoverflow.com/questions/18589986/date-conversion-with-threadlocal

private static final ThreadLocal<SimpleDateFormat> dateFormatterWithSlash = ThreadLocal.withInitial(() -> new SimpleDateFormat(datePattrenWithSlash));

public static String dateFormatterWithSlash_formatDate(Date date) {
    if (date == null )
        return null;

    //return new SimpleDateFormat(dateFormatPattern).format(date);
    return dateFormatterWithSlash.get().format(date);
}

public static Date dateFormatterWithSlash_parseDate(String dateString) throws ParseException {

    Date dateTime = null;
    try {
        dateTime = dateFormatterWithSlash.get().parse(dateString);
    }  catch (ParseException pe2) {
        System.out.println("formatDateAndTime :: unbale to parse to format "+datePattrenWithSlash);
    }

    return dateTime;
}

views – Show latest content date from group content type

I’ve a group type vendor with following groups:

Each group is associated with content type notes as shown below:

Notes (Content Type):

N1 (Group: V1)
N2 (Group: V1)
N3 (Group: V2)
N4 (Group: V2)
N5 (Group: V3)

I want to create a view where following data should be displayed:

V1
    Latest content update date
V2
    Latest content update date

But I do not want all the contents update date listed. When I use grid layout I can group the content as per associated group but the output contains all the last updated date for all contents. I want to limit the output only to last 2-3 contents.

Example:

Views -> Grid Layout -> Group by group title -> Number of columns per row -> 2

Output:

V1

N1 last update date     N2 last update date

V2

N3 last update date     N4 last update date

Expected output:

V1

N1 last update date

V2

N3 last update date

The Sharepoint webpart Date Filter doesn’t switch to the next day after midnight

i have put a webpart Date Filter and a list on Sharepoint page. And connect the DateFilter to the List. But the date filter only switches at 09:00 to the next day and not after midnight. Can this be solved?

enter image description here

Gr. P

Projected opening date of Trail Ridge Rd, Rocky Mountain National Park?

I know it varies each year depending on the amount of snow, but on average around the end of May. How has the recent weather and snowfall been? Planning a trip to Denver soon so it would be great to have a rough estimate of when it will open this year. Thanks in advance!

Selling – Julian Date Converter

Why are you selling this site?

Need to work on different projects
How is it monetized?
PropellerAds and revenuehits
SEMrush

Does this site come with any social media accounts?
no

How much time does this site take to run?
no need to work. Its getting organic traffic

What challenges are there with running this site?
Keep updating the contents

 

oracle 12c – Plsql query to split data based on startdate and end date

I want to split data based on start ,end date ,date range configured (yearly/monthly/weekly/quarterly)

For example if the

Startdate is 2015/10/02 and the

Enddate is 2015/12/22

and my date range is Monthly (M)

then my required output is:

Output
-------------
Newstartdate newEnddate
2015/10/02.   2015/10/31
2015/11/01.   2015/11/30
2015/12/01.   2015/12/30

So I was looking for a generic PL/SQL query to split data what ever date range can be(Y/Q/M/W/D) based on the start and end dates and the range specification.

php – Run if comment date more (+ 1hour) current time

Example:

Server date and time 04.05.2021 9:00

If comment date and time 04.05.2021 9:58 – NOT run

If comment date and time 04.05.2021 10:02 – RUN

$now = current_time( 'mysql' ); 
    
    $datacomm = strtotime( get_comment_date( 'Y-m-d h:i:s', $comment ));
    $later = strtotime( date( 'Y-m-d H:i:s', strtotime( $now ) + 7200 )); //3600 seconds = 1 hour
    
    
    if( $datacomm > $later ) {
    
    // run this
    
    }

My code not work 🙁
Sorry for my English

postgresql – Cumulate count between date with 0 when there are records for a given day

How could one write a Postgresql query that gives both daily and cumulative counts without gaps? E.g. if there is no data for a given day, it would show 0 as a daily count for that that day and the same cumulative sum as the previous day?

I think I’d need GENERATE_SERIES, but I don’t know how to do it. I’m also not entirely sure if order by day asc rows between unbounded preceding and current row would work correctly always, but maybe not the biggest issue here.

I have tried to craft the query with PARTITION BY and

Let’s say I write a table and add data such as

create table test
(
    id int4 NOT NULL GENERATED ALWAYS AS IDENTITY,  
    data int4,  
    created_at timestamptz NOT NULL DEFAULT now()
);

insert into test(data, created_at) values(1, '2021-04-01');
insert into test(data, created_at) values(2, '2021-04-01');
insert into test(data, created_at) values(3, '2021-04-02');
insert into test(data, created_at) values(4, '2021-04-03');
insert into test(data, created_at) values(5, '2021-04-05');
insert into test(data, created_at) values(6, '2021-04-07');

and then create a queries such as

SELECT
  created_at as "Date",
  count(1) as "Daily count"
FROM test
WHERE created_at >= '2021-04-01'
  AND created_at <= '2021-04-30'
GROUP BY 1

giving

Date Daily count
2021-04-01 00:00:00 2
2021-04-02 00:00:00 1
2021-04-03 00:00:00 1
2021-04-05 00:00:00 1
2021-04-07 00:00:00 1
with data as (
  select
    date_trunc('day', created_at) as day,
    count(1)
  from test
  group by 1
)
select
  day,
  running_total(count) over (order by day asc rows between unbounded preceding and current row)
from data
day running_total
2021-04-01 00:00:00 2
2021-04-02 00:00:00 3
2021-04-03 00:00:00 4
2021-04-05 00:00:00 5
2021-04-07 00:00:00 6

But as noted, how could these two be combined without gaps on daily values? Somehow it feels I get close but bump into some (syntax) problem. Maybe those two queries are the simplest and cleanest examples of what I’m thinking.

Time zone to posts before a date

I want to apply a location-based time zone to posts before a certain date. These posts have been converted from a non-Wordpress database and the datetimes are now displayed with a time offset. Can you help me with that? Thanks in advance for the answers!

magento2.3 – Change date of birth date format in Magento 2.3

You do not need to amend the code to acheive this you can update the formatting for dates in magento by the following method

  1. Log in the Magento 2 Admin
  2. Click on the Store section on Admin sidebar.
  3. Under the Setting, Go to Configuration
  4. Expand the Catalog option and choose the catalog option
  5. Set the date and time format to your prefered format and save

This should give you the result your after. you may need to redeploy your website

bin/magento setup:static-content:deploy 

Also you may need to flush the cache

bin/magento c:f

This should now give you the result your after

if the above does work the only other way would be to create an overwrite of MagentoCustomerBlockWidgetDob and amend the getFieldHtml and getHtmlExtraParams functions to replace your with your specific date format