Monday, 30 October 2023

convert laravel date timestamp to Javascript Date

 const jsDate = new Date(data.applied_at);

                const options = {
                    year: 'numeric',
                    month: 'short',
                    day: 'numeric',
                    hour: '2-digit',
                    minute: '2-digit',
                    hour12: true
                };
                const formattedDate = jsDate.toLocaleString('en-US', options);




No comments:

Post a Comment

Laravel Export data to csv

 use Illuminate\Http\Response; // Define a function to export data to CSV function exportToCSV($exportData, $columns) {     $filename = ...