Data Import & Export

How to Preserve Seconds When Importing CSV Date and Time in Excel

Maira MehtabMaira Mehtab Nov 2, 2026 870 views

Question details

Users need to maintain the exact seconds in date and time values when importing or opening CSV files in Excel.

How to Preserve Seconds When Importing CSV Date and Time in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Importing CSV files containing detailed date and timestamp data for analysis or reporting.
Observed behavior
Excel automatically applies default system date formatting when opening CSV files, which often hides the seconds. If the file is saved in this state, the seconds data is permanently lost.
Before you start

Verify that your original CSV file actually contains the seconds data by opening it in a plain text editor like Notepad before importing it into Excel.

Solution 1Recommended

Import CSV using Power Query

Use Excel's Power Query feature to safely import the data without triggering automatic formatting, allowing you to explicitly define the date-time format.

Power Query prevents Excel from automatically interpreting and stripping formatting from your raw CSV text. By setting the data types and custom formats during the import process, you guarantee no data loss occurs.

1
Open the Get Data menu

In Excel, navigate to the 'Data' tab on the ribbon. Click on 'Get Data', select 'From File', and then click 'From Text/CSV'.

2
Select the CSV file

Locate and select the CSV file you want to import, then click 'Import'. When the preview window appears, click the 'Transform Data' button.

3
Set the column data type

In the Power Query Editor, select the column containing your date and time values. Click the data type icon in the column header and change it to 'Date/Time'.

4
Load the data into Excel

Click 'Close & Load' in the top left corner to import the data into your spreadsheet safely.

5
Apply custom time formatting

Highlight the newly imported date-time column in Excel, press 'Ctrl + 1' to open Format Cells, select 'Custom', and enter 'yyyy-mm-dd hh:mm:ss' to ensure the seconds are visible.

Import CSV using Power Query
Safe Exporting: As long as the seconds are visible on your screen using this custom format, saving the worksheet as a new CSV will preserve the complete date-time string.
Efficient Data Management

Import and Format CSV Data Seamlessly with WPS Spreadsheet

WPS Spreadsheet offers an intuitive text import wizard and precise cell formatting capabilities, making it easy to handle complex CSV data without losing important details like timestamps.

  1. 1. Open Data Import: Launch WPS Spreadsheet, navigate to the 'Data' tab, and click on 'Import Data' to select your CSV file.
  2. 2. Use the Text Import Wizard: Follow the prompts in the Text Import Wizard, ensuring you select 'Text' for your date/time columns so the system doesn't truncate the seconds.
  3. 3. Apply Custom Formatting: Select the imported cells, right-click and choose 'Format Cells'. Go to 'Custom' and type 'yyyy-mm-dd hh:mm:ss' to display the exact timestamps.
Precise custom formatting for dates and timesIntuitive Text Import Wizard prevents unwanted automatic formattingFully compatible with Microsoft Excel CSV and XLSX formatsLightweight and completely free to use
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel hide seconds in CSV files by default?

Excel automatically parses recognized date and time formats based on your system's regional settings. Since default system settings typically only display hours and minutes to save space, Excel mimics this behavior and hides the seconds visually.

Can I recover the seconds if I already saved the CSV in Excel?

If you opened the CSV directly in Excel, the seconds were hidden, and you then hit 'Save', Excel overwrites the file with the truncated data. The seconds are permanently lost unless you have a backup of the original CSV file.

Does this issue happen with XLSX files too?

No. When you work with standard Excel workbooks (XLSX), the underlying data retains the seconds even if they are hidden visually by cell formatting. The data loss issue is specific to saving plain-text CSV files while the seconds are hidden.